From: Damjan Marion Date: Wed, 10 Jun 2015 22:19:25 +0000 (+0200) Subject: i40e: prefetch next mbuf in Rx init loop X-Git-Tag: spdx-start~8788 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b91fe0f7ad601848eb468dcbb2159b9a0deaf98a;p=dpdk.git 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] --- 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;