From 5984000d1b6f133a9cf10333c0e6603b0b9e9c61 Mon Sep 17 00:00:00 2001 From: Balazs Nemeth Date: Fri, 26 Mar 2021 12:01:29 +0100 Subject: [PATCH] net/qede: prefetch next packet to free While handling the current mbuf, pull the 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 Reviewed-by: Igor Russkikh --- drivers/net/qede/qede_rxtx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 4f58abfbf2..ed36171607 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -917,6 +917,12 @@ 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) { -- 2.20.1