qcacmn: Rx optimizations to improve small pkt perf
basically tried reading peer_id from peer structure to avoid 1 cache-line miss per pkt and access mac address from frame data for WDS only if WDS condition is valid. The other optimization is to avoid accessing queue_mapping field of skb for skb received which is at 140 offset This again helps to avoid i cache miss. Another place is to do a memcpy only when we intend to add an ast entry. Change-Id: I7e328060c505bc21419d045e77329c2cda9e3644 CRs-fixed: 2388857
This commit is contained in:

committed by
nshrivas

parent
5bcc30f51c
commit
9e4b36fd89
@@ -626,6 +626,10 @@ int dp_peer_add_ast(struct dp_soc *soc,
|
|||||||
ast_entry = dp_peer_ast_hash_find_by_pdevid(soc, mac_addr,
|
ast_entry = dp_peer_ast_hash_find_by_pdevid(soc, mac_addr,
|
||||||
pdev->pdev_id);
|
pdev->pdev_id);
|
||||||
if (ast_entry) {
|
if (ast_entry) {
|
||||||
|
if ((type == CDP_TXRX_AST_TYPE_MEC) &&
|
||||||
|
(ast_entry->type == CDP_TXRX_AST_TYPE_MEC))
|
||||||
|
ast_entry->is_active = TRUE;
|
||||||
|
|
||||||
qdf_spin_unlock_bh(&soc->ast_lock);
|
qdf_spin_unlock_bh(&soc->ast_lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -834,6 +838,13 @@ void dp_peer_del_ast(struct dp_soc *soc, struct dp_ast_entry *ast_entry)
|
|||||||
|
|
||||||
dp_peer_ast_send_wds_del(soc, ast_entry);
|
dp_peer_ast_send_wds_del(soc, ast_entry);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* release the reference only if it is mapped
|
||||||
|
* to ast_table
|
||||||
|
*/
|
||||||
|
if (ast_entry->is_mapped)
|
||||||
|
soc->ast_table[ast_entry->ast_idx] = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if peer map v2 is enabled we are not freeing ast entry
|
* if peer map v2 is enabled we are not freeing ast entry
|
||||||
* here and it is supposed to be freed in unmap event (after
|
* here and it is supposed to be freed in unmap event (after
|
||||||
@@ -853,13 +864,6 @@ void dp_peer_del_ast(struct dp_soc *soc, struct dp_ast_entry *ast_entry)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* release the reference only if it is mapped
|
|
||||||
* to ast_table
|
|
||||||
*/
|
|
||||||
if (ast_entry->is_mapped)
|
|
||||||
soc->ast_table[ast_entry->ast_idx] = NULL;
|
|
||||||
|
|
||||||
/* SELF and STATIC entries are removed in teardown itself */
|
/* SELF and STATIC entries are removed in teardown itself */
|
||||||
if (ast_entry->next_hop)
|
if (ast_entry->next_hop)
|
||||||
TAILQ_REMOVE(&peer->ast_entry_list, ast_entry, ase_list_elem);
|
TAILQ_REMOVE(&peer->ast_entry_list, ast_entry, ase_list_elem);
|
||||||
|
@@ -1386,15 +1386,11 @@ static void dp_rx_msdu_stats_update(struct dp_soc *soc,
|
|||||||
struct cdp_tid_rx_stats *tid_stats)
|
struct cdp_tid_rx_stats *tid_stats)
|
||||||
{
|
{
|
||||||
bool is_ampdu, is_not_amsdu;
|
bool is_ampdu, is_not_amsdu;
|
||||||
uint16_t peer_id;
|
|
||||||
uint32_t sgi, mcs, tid, nss, bw, reception_type, pkt_type;
|
uint32_t sgi, mcs, tid, nss, bw, reception_type, pkt_type;
|
||||||
struct dp_vdev *vdev = peer->vdev;
|
struct dp_vdev *vdev = peer->vdev;
|
||||||
qdf_ether_header_t *eh;
|
qdf_ether_header_t *eh;
|
||||||
uint16_t msdu_len = QDF_NBUF_CB_RX_PKT_LEN(nbuf);
|
uint16_t msdu_len = QDF_NBUF_CB_RX_PKT_LEN(nbuf);
|
||||||
|
|
||||||
peer_id = DP_PEER_METADATA_PEER_ID_GET(
|
|
||||||
hal_rx_mpdu_peer_meta_data_get(rx_tlv_hdr));
|
|
||||||
|
|
||||||
is_not_amsdu = qdf_nbuf_is_rx_chfrag_start(nbuf) &
|
is_not_amsdu = qdf_nbuf_is_rx_chfrag_start(nbuf) &
|
||||||
qdf_nbuf_is_rx_chfrag_end(nbuf);
|
qdf_nbuf_is_rx_chfrag_end(nbuf);
|
||||||
|
|
||||||
@@ -1481,7 +1477,7 @@ static void dp_rx_msdu_stats_update(struct dp_soc *soc,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, vdev->pdev->soc,
|
dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, vdev->pdev->soc,
|
||||||
&peer->stats, peer_id,
|
&peer->stats, peer->peer_ids[0],
|
||||||
UPDATE_PEER_STATS,
|
UPDATE_PEER_STATS,
|
||||||
vdev->pdev->pdev_id);
|
vdev->pdev->pdev_id);
|
||||||
#endif
|
#endif
|
||||||
@@ -2105,8 +2101,6 @@ done:
|
|||||||
if (soc->process_rx_status)
|
if (soc->process_rx_status)
|
||||||
dp_rx_cksum_offload(vdev->pdev, nbuf, rx_tlv_hdr);
|
dp_rx_cksum_offload(vdev->pdev, nbuf, rx_tlv_hdr);
|
||||||
|
|
||||||
dp_set_rx_queue(nbuf, ring_id);
|
|
||||||
|
|
||||||
/* Update the protocol tag in SKB based on CCE metadata */
|
/* Update the protocol tag in SKB based on CCE metadata */
|
||||||
dp_rx_update_protocol_tag(soc, vdev, nbuf, rx_tlv_hdr,
|
dp_rx_update_protocol_tag(soc, vdev, nbuf, rx_tlv_hdr,
|
||||||
reo_ring_num, false, true);
|
reo_ring_num, false, true);
|
||||||
|
@@ -439,7 +439,7 @@ void dp_rx_add_to_free_desc_list(union dp_rx_desc_list_elem_t **head,
|
|||||||
#ifdef FEATURE_WDS
|
#ifdef FEATURE_WDS
|
||||||
static inline void
|
static inline void
|
||||||
dp_rx_wds_add_or_update_ast(struct dp_soc *soc, struct dp_peer *ta_peer,
|
dp_rx_wds_add_or_update_ast(struct dp_soc *soc, struct dp_peer *ta_peer,
|
||||||
uint8_t *wds_src_mac, uint8_t is_ad4_valid,
|
qdf_nbuf_t nbuf, uint8_t is_ad4_valid,
|
||||||
uint8_t is_sa_valid, uint8_t is_chfrag_start,
|
uint8_t is_sa_valid, uint8_t is_chfrag_start,
|
||||||
uint16_t sa_idx, uint16_t sa_sw_peer_id)
|
uint16_t sa_idx, uint16_t sa_sw_peer_id)
|
||||||
{
|
{
|
||||||
@@ -449,6 +449,7 @@ dp_rx_wds_add_or_update_ast(struct dp_soc *soc, struct dp_peer *ta_peer,
|
|||||||
uint32_t ret = 0;
|
uint32_t ret = 0;
|
||||||
struct dp_neighbour_peer *neighbour_peer = NULL;
|
struct dp_neighbour_peer *neighbour_peer = NULL;
|
||||||
struct dp_pdev *pdev = ta_peer->vdev->pdev;
|
struct dp_pdev *pdev = ta_peer->vdev->pdev;
|
||||||
|
uint8_t wds_src_mac[QDF_MAC_ADDR_SIZE];
|
||||||
|
|
||||||
/* For AP mode : Do wds source port learning only if it is a
|
/* For AP mode : Do wds source port learning only if it is a
|
||||||
* 4-address mpdu
|
* 4-address mpdu
|
||||||
@@ -470,6 +471,10 @@ dp_rx_wds_add_or_update_ast(struct dp_soc *soc, struct dp_peer *ta_peer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qdf_unlikely(!is_sa_valid)) {
|
if (qdf_unlikely(!is_sa_valid)) {
|
||||||
|
qdf_mem_copy(wds_src_mac,
|
||||||
|
(qdf_nbuf_data(nbuf) + QDF_MAC_ADDR_SIZE),
|
||||||
|
QDF_MAC_ADDR_SIZE);
|
||||||
|
|
||||||
ret = dp_peer_add_ast(soc,
|
ret = dp_peer_add_ast(soc,
|
||||||
ta_peer,
|
ta_peer,
|
||||||
wds_src_mac,
|
wds_src_mac,
|
||||||
@@ -497,6 +502,10 @@ dp_rx_wds_add_or_update_ast(struct dp_soc *soc, struct dp_peer *ta_peer,
|
|||||||
* cached.
|
* cached.
|
||||||
*/
|
*/
|
||||||
if (!soc->ast_override_support) {
|
if (!soc->ast_override_support) {
|
||||||
|
qdf_mem_copy(wds_src_mac,
|
||||||
|
(qdf_nbuf_data(nbuf) + QDF_MAC_ADDR_SIZE),
|
||||||
|
QDF_MAC_ADDR_SIZE);
|
||||||
|
|
||||||
ret = dp_peer_add_ast(soc,
|
ret = dp_peer_add_ast(soc,
|
||||||
ta_peer,
|
ta_peer,
|
||||||
wds_src_mac,
|
wds_src_mac,
|
||||||
@@ -512,6 +521,11 @@ dp_rx_wds_add_or_update_ast(struct dp_soc *soc, struct dp_peer *ta_peer,
|
|||||||
* to FW.
|
* to FW.
|
||||||
*/
|
*/
|
||||||
if (pdev->neighbour_peers_added) {
|
if (pdev->neighbour_peers_added) {
|
||||||
|
qdf_mem_copy(wds_src_mac,
|
||||||
|
(qdf_nbuf_data(nbuf) +
|
||||||
|
QDF_MAC_ADDR_SIZE),
|
||||||
|
QDF_MAC_ADDR_SIZE);
|
||||||
|
|
||||||
qdf_spin_lock_bh(&pdev->neighbour_peer_mutex);
|
qdf_spin_lock_bh(&pdev->neighbour_peer_mutex);
|
||||||
TAILQ_FOREACH(neighbour_peer,
|
TAILQ_FOREACH(neighbour_peer,
|
||||||
&pdev->neighbour_peers_list,
|
&pdev->neighbour_peers_list,
|
||||||
@@ -624,7 +638,6 @@ dp_rx_wds_srcport_learn(struct dp_soc *soc,
|
|||||||
{
|
{
|
||||||
uint16_t sa_sw_peer_id = hal_rx_msdu_end_sa_sw_peer_id_get(rx_tlv_hdr);
|
uint16_t sa_sw_peer_id = hal_rx_msdu_end_sa_sw_peer_id_get(rx_tlv_hdr);
|
||||||
uint8_t sa_is_valid = hal_rx_msdu_end_sa_is_valid_get(rx_tlv_hdr);
|
uint8_t sa_is_valid = hal_rx_msdu_end_sa_is_valid_get(rx_tlv_hdr);
|
||||||
uint8_t wds_src_mac[QDF_MAC_ADDR_SIZE];
|
|
||||||
uint16_t sa_idx;
|
uint16_t sa_idx;
|
||||||
uint8_t is_chfrag_start = 0;
|
uint8_t is_chfrag_start = 0;
|
||||||
uint8_t is_ad4_valid = 0;
|
uint8_t is_ad4_valid = 0;
|
||||||
@@ -636,15 +649,12 @@ dp_rx_wds_srcport_learn(struct dp_soc *soc,
|
|||||||
if (is_chfrag_start)
|
if (is_chfrag_start)
|
||||||
is_ad4_valid = hal_rx_get_mpdu_mac_ad4_valid(rx_tlv_hdr);
|
is_ad4_valid = hal_rx_get_mpdu_mac_ad4_valid(rx_tlv_hdr);
|
||||||
|
|
||||||
memcpy(wds_src_mac, (qdf_nbuf_data(nbuf) + QDF_MAC_ADDR_SIZE),
|
|
||||||
QDF_MAC_ADDR_SIZE);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the AST entry from HW SA index and mark it as active
|
* Get the AST entry from HW SA index and mark it as active
|
||||||
*/
|
*/
|
||||||
sa_idx = hal_rx_msdu_end_sa_idx_get(rx_tlv_hdr);
|
sa_idx = hal_rx_msdu_end_sa_idx_get(rx_tlv_hdr);
|
||||||
|
|
||||||
dp_rx_wds_add_or_update_ast(soc, ta_peer, wds_src_mac, is_ad4_valid,
|
dp_rx_wds_add_or_update_ast(soc, ta_peer, nbuf, is_ad4_valid,
|
||||||
sa_is_valid, is_chfrag_start,
|
sa_is_valid, is_chfrag_start,
|
||||||
sa_idx, sa_sw_peer_id);
|
sa_idx, sa_sw_peer_id);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user