diff mbox series

[7/8] net/qede: prefetch next packet to free

Message ID 5ad79e09884d954f772e386c71fcf84fe212085b.1614938727.git.bnemeth@redhat.com (mailing list archive)
State Changes Requested
Delegated to: Jerin Jacob
Headers show
Series Optimize qede use of rx/tx_entries | expand


Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Balazs Nemeth March 5, 2021, 1:14 p.m. UTC
While handling the current mbuf, pull the next next mbuf into the cache.
Note that the last four mbufs pulled into the cache are not handled, but
that doesn't matter.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
 drivers/net/qede/qede_rxtx.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series


diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index b74a1ec1b..e89498811 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -915,6 +915,11 @@  qede_process_tx_compl(__rte_unused struct ecore_dev *edev,
 		nb_segs = mbuf->nb_segs;
 		remaining -= nb_segs;
+		/* Prefetch the next mbuf. Note that at least the last 4 mbufs
+		   that are prefetched will not be used in the current call. */
+		rte_mbuf_prefetch_part1(txq->sw_tx_ring[(idx + 4) & mask]);
+		rte_mbuf_prefetch_part2(txq->sw_tx_ring[(idx + 4) & mask]);
 		PMD_TX_LOG(DEBUG, txq, "nb_segs to free %u\n", nb_segs);
 		while (nb_segs) {