[dpdk-dev] net/mlx4: fix rx not working after mbuf alloc failure
Checks
Commit Message
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
@@ -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;
}