patch 'net/mlx5: fix multi-segment packet wraparound' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Sun Nov 28 15:54:12 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/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/d2291cc9998f381214141f1a16fa60e7ff2b020a

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d2291cc9998f381214141f1a16fa60e7ff2b020a Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski at nvidia.com>
Date: Tue, 23 Nov 2021 15:57:40 +0200
Subject: [PATCH] net/mlx5: fix multi-segment packet wraparound
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit fa4883456d86fef8364e6dd90c57f134f28d46bf ]

This patch fixes the assertion failure triggered when the user
configured minimum inline length requirements and the application
transmitted multi segment packets. Failure was triggered when space left
in TX queue was not enough to cover this requirement.

This patch limits the length of data to be copied to the available space
in TX queue.

Fixes: cacb44a09962 ("net/mlx5: add no-inline Tx flag")

Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 97e0995c66..5012f2a74f 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -2584,7 +2584,6 @@ mlx5_tx_mseg_memcpy(uint8_t *pdst,
 	uint8_t *psrc;
 
 	MLX5_ASSERT(len);
-	MLX5_ASSERT(must <= len);
 	do {
 		/* Allow zero length packets, must check first. */
 		dlen = rte_pktmbuf_data_len(loc->mbuf);
@@ -2611,9 +2610,11 @@ mlx5_tx_mseg_memcpy(uint8_t *pdst,
 				if (diff <= rte_pktmbuf_data_len(loc->mbuf)) {
 					/*
 					 * Copy only the minimal required
-					 * part of the data buffer.
+					 * part of the data buffer. Limit amount
+					 * of data to be copied to the length of
+					 * available space.
 					 */
-					len = diff;
+					len = RTE_MIN(len, diff);
 				}
 			}
 			continue;
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-28 22:41:06.695670432 +0800
+++ 0068-net-mlx5-fix-multi-segment-packet-wraparound.patch	2021-11-28 22:41:03.423539109 +0800
@@ -1 +1 @@
-From fa4883456d86fef8364e6dd90c57f134f28d46bf Mon Sep 17 00:00:00 2001
+From d2291cc9998f381214141f1a16fa60e7ff2b020a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit fa4883456d86fef8364e6dd90c57f134f28d46bf ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
- drivers/net/mlx5/mlx5_tx.h | 7 ++++---
+ drivers/net/mlx5/mlx5_rxtx.c | 7 ++++---
@@ -23,5 +25,5 @@
-diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h
-index bc629983fa..099e72935a 100644
---- a/drivers/net/mlx5/mlx5_tx.h
-+++ b/drivers/net/mlx5/mlx5_tx.h
-@@ -1071,7 +1071,6 @@ mlx5_tx_mseg_memcpy(uint8_t *pdst,
+diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
+index 97e0995c66..5012f2a74f 100644
+--- a/drivers/net/mlx5/mlx5_rxtx.c
++++ b/drivers/net/mlx5/mlx5_rxtx.c
+@@ -2584,7 +2584,6 @@ mlx5_tx_mseg_memcpy(uint8_t *pdst,
@@ -35 +37 @@
-@@ -1098,9 +1097,11 @@ mlx5_tx_mseg_memcpy(uint8_t *pdst,
+@@ -2611,9 +2610,11 @@ mlx5_tx_mseg_memcpy(uint8_t *pdst,


More information about the stable mailing list