From b91fe0f7ad601848eb468dcbb2159b9a0deaf98a Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 11 Jun 2015 00:19:25 +0200 Subject: [PATCH] i40e: prefetch next mbuf in Rx init loop This patch improves performance of Rx with i40e devices. Signed-off-by: Damjan Marion Acked-by: Helin Zhang [Thomas: apply Helin's comments] --- drivers/net/i40e/i40e_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 6daf1dca19..21b8edd38b 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -813,6 +813,10 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq) rxdp = &rxq->rx_ring[alloc_idx]; for (i = 0; i < rxq->rx_free_thresh; i++) { + if (likely(i < (rxq->rx_free_thresh - 1))) + /* Prefetch next mbuf */ + rte_prefetch0(rxep[i + 1].mbuf); + mb = rxep[i].mbuf; rte_mbuf_refcnt_set(mb, 1); mb->next = NULL; -- 2.20.1