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

Message ID BY2PR1001MB11763C697502CAED06261E15EE020@BY2PR1001MB1176.namprd10.prod.outlook.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Myers, Charles April 13, 2017, 7:52 a.m. UTC
  I ran into an issue where the 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 the
(wc.status != IBV_WC_SUCCESS) case.

Copying the code from the above case before jumping to repost fixes the issue for me.

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

--
1.7.9.5
  

Patch

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,9 @@  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;
 		}