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
diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c
index 41d101d..fb8afd0 100644
--- a/dp/wifi3.0/dp_peer.c
+++ b/dp/wifi3.0/dp_peer.c
@@ -626,6 +626,10 @@
ast_entry = dp_peer_ast_hash_find_by_pdevid(soc, mac_addr,
pdev->pdev_id);
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);
return 0;
}
@@ -835,6 +839,13 @@
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
* here and it is supposed to be freed in unmap event (after
* we receive delete confirmation from target)
@@ -853,13 +864,6 @@
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 */
if (ast_entry->next_hop)
TAILQ_REMOVE(&peer->ast_entry_list, ast_entry, ase_list_elem);
diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c
index d638492..9507bd9 100644
--- a/dp/wifi3.0/dp_rx.c
+++ b/dp/wifi3.0/dp_rx.c
@@ -1386,15 +1386,11 @@
struct cdp_tid_rx_stats *tid_stats)
{
bool is_ampdu, is_not_amsdu;
- uint16_t peer_id;
uint32_t sgi, mcs, tid, nss, bw, reception_type, pkt_type;
struct dp_vdev *vdev = peer->vdev;
qdf_ether_header_t *eh;
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) &
qdf_nbuf_is_rx_chfrag_end(nbuf);
@@ -1481,7 +1477,7 @@
return;
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,
vdev->pdev->pdev_id);
#endif
@@ -2105,8 +2101,6 @@
if (soc->process_rx_status)
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 */
dp_rx_update_protocol_tag(soc, vdev, nbuf, rx_tlv_hdr,
reo_ring_num, false, true);
diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h
index ec9f870..d73a5cd 100644
--- a/dp/wifi3.0/dp_rx.h
+++ b/dp/wifi3.0/dp_rx.h
@@ -439,7 +439,7 @@
#ifdef FEATURE_WDS
static inline void
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,
uint16_t sa_idx, uint16_t sa_sw_peer_id)
{
@@ -449,6 +449,7 @@
uint32_t ret = 0;
struct dp_neighbour_peer *neighbour_peer = NULL;
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
* 4-address mpdu
@@ -470,6 +471,10 @@
}
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,
ta_peer,
wds_src_mac,
@@ -497,6 +502,10 @@
* cached.
*/
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,
ta_peer,
wds_src_mac,
@@ -512,6 +521,11 @@
* to FW.
*/
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);
TAILQ_FOREACH(neighbour_peer,
&pdev->neighbour_peers_list,
@@ -624,7 +638,6 @@
{
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 wds_src_mac[QDF_MAC_ADDR_SIZE];
uint16_t sa_idx;
uint8_t is_chfrag_start = 0;
uint8_t is_ad4_valid = 0;
@@ -636,15 +649,12 @@
if (is_chfrag_start)
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
*/
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_idx, sa_sw_peer_id);