[dpdk-stable] patch 'net/mlx5: fix Rx segmented packets on mbuf starvation' has been queued to stable release 20.11.2
Xueming Li
xuemingl at nvidia.com
Mon May 10 17:59:50 CEST 2021
Hi,
FYI, your patch has been queued to stable release 20.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk
This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/6f1a03c53ef11381577d7f9c8216c9ec4da7fb63
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 6f1a03c53ef11381577d7f9c8216c9ec4da7fb63 Mon Sep 17 00:00:00 2001
From: Jiawei Zhu <zhujiawei12 at huawei.com>
Date: Mon, 1 Mar 2021 12:19:50 -0500
Subject: [PATCH] net/mlx5: fix Rx segmented packets on mbuf starvation
Cc: Luca Boccassi <bluca at debian.org>
[ upstream commit c9678e49feef4e423ebd917c7670fee238f4c2bb ]
The issue occurred if mbuf starvation happened
in the middle of segmented packet reception.
In such a situation, after release the segments of
packet being received, code did not advance the
consumer index to the next stride. This caused
the receiving of the wrong segmented packet data.
The possible error scenario:
- we assume segs_n is 4 and we are receiving 4
segments of multi-segment packet.
- we fail to allocate mbuf while receiving the 3rd segment,
and this frees the mbufs of the packet chain we have built.
There are the 1st and 2nd segments in the chain.
- the 1st and the 2nd segments of this stride of Rx queue
are filled up (in elts array) with the new allocated
mbufs and their data are random (the 3rd and 4th
segments still contain the valid data of the packet though).
- on the next iteration of stride processing we get
the wrong two segments of the multi-segment packet.
Hence, we should skip these mbufs in the stride and
we should advance the consumer index on loop exit.
Fixes: 15a756b63734 ("net/mlx5: fix possible NULL dereference in Rx path")
Signed-off-by: Jiawei Zhu <zhujiawei12 at huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
drivers/net/mlx5/mlx5_rxtx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index d12d746c2f..fac823ba64 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1430,6 +1430,9 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
rte_mbuf_raw_free(pkt);
pkt = rep;
}
+ rq_ci >>= sges_n;
+ ++rq_ci;
+ rq_ci <<= sges_n;
break;
}
if (!pkt) {
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-05-10 23:59:27.754244800 +0800
+++ 0042-net-mlx5-fix-Rx-segmented-packets-on-mbuf-starvation.patch 2021-05-10 23:59:26.380000000 +0800
@@ -1 +1 @@
-From c9678e49feef4e423ebd917c7670fee238f4c2bb Mon Sep 17 00:00:00 2001
+From 6f1a03c53ef11381577d7f9c8216c9ec4da7fb63 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit c9678e49feef4e423ebd917c7670fee238f4c2bb ]
@@ -30 +32,0 @@
-Cc: stable at dpdk.org
@@ -39 +41 @@
-index 2e4b87c3e5..e3ce9fd224 100644
+index d12d746c2f..fac823ba64 100644
@@ -42 +44 @@
-@@ -1480,6 +1480,9 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
+@@ -1430,6 +1430,9 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
More information about the stable
mailing list