patch 'net/mlx5: fix port initialization with small LRO' has been queued to stable release 20.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Nov 18 00:08:39 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.7

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/19/22. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/ff0263d0f18a44a27c61a2e5c554d13be184f103

Thanks.

Luca Boccassi

---
>From ff0263d0f18a44a27c61a2e5c554d13be184f103 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Wed, 9 Nov 2022 18:50:38 +0200
Subject: [PATCH] net/mlx5: fix port initialization with small LRO

[ upstream commit b9f1f4c2394d1fd03ec2e27f8bad6c24153fa228 ]

If application provided maximal LRO size was less than expected PMD
minimum, the PMD either crashed with assert, if asserts were enabled,
or proceeded with port initialization to set port private maximal
LRO size below supported minimum.

The patch terminates port start if LRO size
does not match PMD requirements and TCP LRO offload was requested
at least for one Rx queue.

Fixes: 50c00baff763 ("net/mlx5: limit LRO size to maximum Rx packet")

Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c     |  1 -
 drivers/net/mlx5/mlx5_trigger.c | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index cb79a8b772..048d1c571b 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1378,7 +1378,6 @@ mlx5_max_lro_msg_size_adjust(struct rte_eth_dev *dev, uint16_t idx,
 	    MLX5_MAX_TCP_HDR_OFFSET)
 		max_lro_size -= MLX5_MAX_TCP_HDR_OFFSET;
 	max_lro_size = RTE_MIN(max_lro_size, MLX5_MAX_LRO_SIZE);
-	MLX5_ASSERT(max_lro_size >= MLX5_LRO_SEG_CHUNK_SIZE);
 	max_lro_size /= MLX5_LRO_SEG_CHUNK_SIZE;
 	if (priv->max_lro_msg_size)
 		priv->max_lro_msg_size =
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 9b82ee40fd..3440947f3e 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1070,6 +1070,22 @@ mlx5_dev_start(struct rte_eth_dev *dev)
 	else
 		rte_net_mlx5_dynf_inline_mask = 0;
 	if (dev->data->nb_rx_queues > 0) {
+		uint32_t max_lro_msg_size = priv->max_lro_msg_size;
+
+		if (max_lro_msg_size < MLX5_LRO_SEG_CHUNK_SIZE) {
+			uint32_t i;
+			struct mlx5_rxq_ctrl *rxq_ctrl;
+
+			for (i = 0; i != priv->rxqs_n; ++i) {
+				rxq_ctrl = mlx5_rxq_get(dev, i);
+				if (rxq_ctrl && rxq_ctrl->rxq.lro) {
+					DRV_LOG(ERR, "port %u invalid max LRO size",
+						dev->data->port_id);
+					rte_errno = EINVAL;
+					return -rte_errno;
+				}
+			}
+		}
 		ret = mlx5_dev_configure_rss_reta(dev);
 		if (ret) {
 			DRV_LOG(ERR, "port %u reta config failed: %s",
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-11-17 23:07:56.154712231 +0000
+++ 0015-net-mlx5-fix-port-initialization-with-small-LRO.patch	2022-11-17 23:07:55.488330277 +0000
@@ -1 +1 @@
-From b9f1f4c2394d1fd03ec2e27f8bad6c24153fa228 Mon Sep 17 00:00:00 2001
+From ff0263d0f18a44a27c61a2e5c554d13be184f103 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b9f1f4c2394d1fd03ec2e27f8bad6c24153fa228 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index 0d9d11680b..724cd6c7e6 100644
+index cb79a8b772..048d1c571b 100644
@@ -29 +30 @@
-@@ -1533,7 +1533,6 @@ mlx5_max_lro_msg_size_adjust(struct rte_eth_dev *dev, uint16_t idx,
+@@ -1378,7 +1378,6 @@ mlx5_max_lro_msg_size_adjust(struct rte_eth_dev *dev, uint16_t idx,
@@ -38 +39 @@
-index 4b821a1076..71089299b8 100644
+index 9b82ee40fd..3440947f3e 100644
@@ -41 +42 @@
-@@ -1167,6 +1167,22 @@ continue_dev_start:
+@@ -1070,6 +1070,22 @@ mlx5_dev_start(struct rte_eth_dev *dev)
@@ -49 +50 @@
-+			struct mlx5_rxq_priv *rxq;
++			struct mlx5_rxq_ctrl *rxq_ctrl;
@@ -52,2 +53,2 @@
-+				rxq = mlx5_rxq_get(dev, i);
-+				if (rxq && rxq->ctrl && rxq->ctrl->rxq.lro) {
++				rxq_ctrl = mlx5_rxq_get(dev, i);
++				if (rxq_ctrl && rxq_ctrl->rxq.lro) {


More information about the stable mailing list