Procházet zdrojové kódy

qcacmn: Prefetch tx desc and nbuf in lithuim Tx. send path

Prefetch tx desc and nbuf in lithuim Tx. send path.
This improves the UDP DL CPU idle% by ~1.5%

Change-Id: Ibd31d979c859824ed9f6b34a2685f8b9c4a7635d
Neha Bisht před 3 roky
rodič
revize
631d7e1a7d
2 změnil soubory, kde provedl 32 přidání a 0 odebrání
  1. 17 0
      dp/wifi3.0/dp_tx.c
  2. 15 0
      dp/wifi3.0/dp_tx_desc.h

+ 17 - 0
dp/wifi3.0/dp_tx.c

@@ -3048,6 +3048,22 @@ void dp_tx_nawds_handler(struct dp_soc *soc, struct dp_vdev *vdev,
 	qdf_spin_unlock_bh(&vdev->peer_list_lock);
 }
 
+#ifdef QCA_DP_TX_NBUF_AND_NBUF_DATA_PREFETCH
+static inline
+void dp_tx_prefetch_nbuf_data(qdf_nbuf_t nbuf)
+{
+	if (nbuf) {
+		qdf_prefetch(&nbuf->len);
+		qdf_prefetch(&nbuf->data);
+	}
+}
+#else
+static inline
+void dp_tx_prefetch_nbuf_data(qdf_nbuf_t nbuf)
+{
+}
+#endif
+
 /**
  * dp_tx_send() - Transmit a frame on a given VAP
  * @soc: DP soc handle
@@ -3200,6 +3216,7 @@ qdf_nbuf_t dp_tx_send(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
 	 * prepare direct-buffer type TCL descriptor and enqueue to TCL
 	 * SRNG. There is no need to setup a MSDU extension descriptor.
 	 */
+	dp_tx_prefetch_nbuf_data(nbuf);
 	nbuf = dp_tx_send_msdu_single(vdev, nbuf, &msdu_info, peer_id, NULL);
 
 	return nbuf;

+ 15 - 0
dp/wifi3.0/dp_tx_desc.h

@@ -637,6 +637,20 @@ static inline void dp_tx_flow_pool_unmap_handler(struct dp_pdev *pdev,
 {
 }
 
+#ifdef QCA_DP_TX_HW_SW_NBUF_DESC_PREFETCH
+static inline
+void dp_tx_prefetch_desc(struct dp_tx_desc_s *tx_desc)
+{
+	if (tx_desc)
+		prefetch(tx_desc);
+}
+#else
+static inline
+void dp_tx_prefetch_desc(struct dp_tx_desc_s *tx_desc)
+{
+}
+#endif
+
 /**
  * dp_tx_desc_alloc() - Allocate a Software Tx Descriptor from given pool
  *
@@ -664,6 +678,7 @@ static inline struct dp_tx_desc_s *dp_tx_desc_alloc(struct dp_soc *soc,
 	pool->freelist = pool->freelist->next;
 	pool->num_allocated++;
 	pool->num_free--;
+	dp_tx_prefetch_desc(pool->freelist);
 
 	tx_desc->flags = DP_TX_DESC_FLAG_ALLOCATED;