From: Harry van Haaren Date: Mon, 30 Jul 2018 17:34:19 +0000 (+0100) Subject: net/i40e: fix rearm check in AVX2 Rx X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f5dd9a88dedd54fa89a25c9a10d39f3abe31e5c2;p=dpdk.git net/i40e: fix rearm check in AVX2 Rx This commit fixes an infinite loop bug that could occur if the i40e AVX2 driver is used, and high traffic rates cause the mempool from which the rxq pulls mbufs to become empty. The result would be an infinite loop of checking if we should perform an rx rearm, calling the function and an error return due the the mempool being emtpy. The fix is to align the code in the AVX2 driver with the SSE driver, where an if() is used instead of a while(), allowing the thread to return from i40e rx function even if the mempool is empty. Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function") Cc: stable@dpdk.org Reported-by: David Coyle Signed-off-by: Harry van Haaren Acked-by: Brendan Ryan Tested-by: David Coyle --- diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c index dbcb61f38f..23179b3b85 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c +++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c @@ -188,7 +188,7 @@ _recv_raw_pkts_vec_avx2(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, /* See if we need to rearm the RX queue - gives the prefetch a bit * of time to act */ - while (rxq->rxrearm_nb > RTE_I40E_RXQ_REARM_THRESH) + if (rxq->rxrearm_nb > RTE_I40E_RXQ_REARM_THRESH) i40e_rxq_rearm(rxq); /* Before we start moving massive data around, check to see if