瀏覽代碼

qcacmn: prefetch nbuf data and nbuf fields for Beryllium

prefetch certain nbuf fields and nbuf data fields, this
will ensure these fields are in cacheline by the next
iteration of the rx processing loop.

CRs-Fixed: 3146589
Change-Id: I69fd9a7800c7e881cf6635f329343195d19735c5
Tallapragada Kalyan 3 年之前
父節點
當前提交
edbfac7e2e
共有 2 個文件被更改,包括 24 次插入0 次删除
  1. 1 0
      dp/wifi3.0/be/dp_be_rx.c
  2. 23 0
      dp/wifi3.0/be/dp_be_rx.h

+ 1 - 0
dp/wifi3.0/be/dp_be_rx.c

@@ -495,6 +495,7 @@ done:
 	nbuf = nbuf_head;
 	while (nbuf) {
 		next = nbuf->next;
+		dp_rx_prefetch_nbuf_data_be(nbuf, next);
 		if (qdf_unlikely(dp_rx_is_raw_frame_dropped(nbuf))) {
 			nbuf = next;
 			DP_STATS_INC(soc, rx.err.raw_frm_drop, 1);

+ 23 - 0
dp/wifi3.0/be/dp_be_rx.h

@@ -370,4 +370,27 @@ QDF_STATUS dp_peer_rx_reorder_queue_setup_be(struct dp_soc *soc,
 	return QDF_STATUS_SUCCESS;
 }
 #endif /* WLAN_FEATURE_11BE_MLO */
+
+#ifdef QCA_DP_RX_NBUF_AND_NBUF_DATA_PREFETCH
+static inline
+void dp_rx_prefetch_nbuf_data_be(qdf_nbuf_t nbuf, qdf_nbuf_t next)
+{
+	if (next) {
+		/* prefetch skb->next and first few bytes of skb->cb */
+		qdf_prefetch(next);
+		/* skb->cb spread across 2 cache lines hence below prefetch */
+		qdf_prefetch(&next->_skb_refdst);
+		qdf_prefetch(&next->len);
+		qdf_prefetch(&next->protocol);
+		qdf_prefetch(next->data);
+		qdf_prefetch(next->data + 64);
+		qdf_prefetch(next->data + 128);
+	}
+}
+#else
+static inline
+void dp_rx_prefetch_nbuf_data_be(qdf_nbuf_t nbuf, qdf_nbuf_t next)
+{
+}
+#endif
 #endif