[dpdk-dev] [PATCH] net/mlx4: fix rx not working after mbuf alloc failure

Charles Myers Charles.Myers at spirent.com
Fri Apr 14 00:15:24 CEST 2017


From: Charles <Charles.Myers at spirent.com>

Fixes issue where mlx4 driver stops receiving packets when mbuf
allocation fails in mlx4_rx_burst().

This issue appears to be caused because the code doesn't recycle the
existing mbuf to the sges array when mbuf allocation fails as is done
in the code right above it which handles (wc.status != IBV_WC_SUCCESS).

Copying the code from the above case fixes the issue.

Fixes: acac55f16412 ("mlx4: use MOFED 3.0 fast verbs interface for Rx
operations")

Signed-off-by: Charles Myers <Charles.Myers at spirent.com>
---
 drivers/net/mlx4/mlx4.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index aff9155..59d26fe 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -3169,6 +3169,8 @@ struct txq_mp2mr_mbuf_check_data {
 			/* Increase out of memory counters. */
 			++rxq->stats.rx_nombuf;
 			++rxq->priv->dev->data->rx_mbuf_alloc_failed;
+			/* Add SGE to array for repost. */
+			sges[i] = elt->sge;
 			goto repost;
 		}
 
-- 
1.7.9.5



More information about the dev mailing list