patch 'net/mlx5: fix MPRQ stride size check' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Mon Dec 11 11:12:00 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.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 12/13/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=d3741774d0daa3702a711df16d16428e06e33354

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d3741774d0daa3702a711df16d16428e06e33354 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev at nvidia.com>
Date: Thu, 12 Oct 2023 19:34:33 +0300
Subject: [PATCH] net/mlx5: fix MPRQ stride size check
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit fdee0f1b30ae8dfc431465878aae5295372cca6f ]

We should only check that MPRQ stride size is bigger than the mbuf size
in case no devarg configuration has been provided. Headroom check was
indtroduced recently and removed this condition inadvertently.
Restore this condition and only check if mprq_log_stride_size is not set.

Fixes: e6479f009fbd ("net/mlx5: fix MPRQ stride size for headroom")

Signed-off-by: Alexander Kozyrev <akozyrev at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5.c     |  2 +-
 drivers/net/mlx5/mlx5_rxq.c | 25 ++++++++++++++-----------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 90dbb6e3b0..1a5f95b22b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2494,7 +2494,7 @@ mlx5_port_args_config(struct mlx5_priv *priv, struct mlx5_kvargs_ctrl *mkvlist,
 	config->mprq.max_memcpy_len = MLX5_MPRQ_MEMCPY_DEFAULT_LEN;
 	config->mprq.min_rxqs_num = MLX5_MPRQ_MIN_RXQS;
 	config->mprq.log_stride_num = MLX5_MPRQ_DEFAULT_LOG_STRIDE_NUM;
-	config->mprq.log_stride_size = MLX5_MPRQ_DEFAULT_LOG_STRIDE_SIZE;
+	config->mprq.log_stride_size = MLX5_ARG_UNSET;
 	config->log_hp_size = MLX5_ARG_UNSET;
 	config->std_delay_drop = 0;
 	config->hp_delay_drop = 0;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 834707ea87..9179b9d9d7 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1602,18 +1602,19 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		*actual_log_stride_num = config->mprq.log_stride_num;
 	}
 	/* Checks if chosen size of stride is in supported range. */
-	if (config->mprq.log_stride_size > log_max_stride_size ||
-	    config->mprq.log_stride_size < log_min_stride_size) {
-		*actual_log_stride_size = log_def_stride_size;
-		DRV_LOG(WARNING,
-			"Port %u Rx queue %u size of a stride for Multi-Packet RQ is out of range, setting default value (%u)",
-			dev->data->port_id, idx,
-			RTE_BIT32(log_def_stride_size));
+	if (config->mprq.log_stride_size != (uint32_t)MLX5_ARG_UNSET) {
+		if (config->mprq.log_stride_size > log_max_stride_size ||
+			config->mprq.log_stride_size < log_min_stride_size) {
+			*actual_log_stride_size = log_def_stride_size;
+			DRV_LOG(WARNING,
+				"Port %u Rx queue %u size of a stride for Multi-Packet RQ is out of range, setting default value (%u)",
+				dev->data->port_id, idx,
+				RTE_BIT32(log_def_stride_size));
+		} else {
+			*actual_log_stride_size = config->mprq.log_stride_size;
+		}
 	} else {
-		*actual_log_stride_size = config->mprq.log_stride_size;
-	}
-	/* Make the stride fit the mbuf size by default. */
-	if (*actual_log_stride_size == MLX5_MPRQ_DEFAULT_LOG_STRIDE_SIZE) {
+		/* Make the stride fit the mbuf size by default. */
 		if (min_mbuf_size <= RTE_BIT32(log_max_stride_size)) {
 			DRV_LOG(WARNING,
 				"Port %u Rx queue %u size of a stride for Multi-Packet RQ is adjusted to match the mbuf size (%u)",
@@ -1672,6 +1673,8 @@ unsupport:
 			" min_stride_sz = %u, max_stride_sz = %u).\n"
 			"Rx segment is %senabled. External mempool is %sused.",
 			dev->data->port_id, min_mbuf_size, desc, priv->rxqs_n,
+			config->mprq.log_stride_size == (uint32_t)MLX5_ARG_UNSET ?
+			RTE_BIT32(MLX5_MPRQ_DEFAULT_LOG_STRIDE_SIZE) :
 			RTE_BIT32(config->mprq.log_stride_size),
 			RTE_BIT32(config->mprq.log_stride_num),
 			config->mprq.min_rxqs_num,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-11 17:56:26.192184600 +0800
+++ 0095-net-mlx5-fix-MPRQ-stride-size-check.patch	2023-12-11 17:56:23.207652300 +0800
@@ -1 +1 @@
-From fdee0f1b30ae8dfc431465878aae5295372cca6f Mon Sep 17 00:00:00 2001
+From d3741774d0daa3702a711df16d16428e06e33354 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit fdee0f1b30ae8dfc431465878aae5295372cca6f ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index d6cb0d1c8a..3a182de248 100644
+index 90dbb6e3b0..1a5f95b22b 100644
@@ -25 +27 @@
-@@ -2709,7 +2709,7 @@ mlx5_port_args_config(struct mlx5_priv *priv, struct mlx5_kvargs_ctrl *mkvlist,
+@@ -2494,7 +2494,7 @@ mlx5_port_args_config(struct mlx5_priv *priv, struct mlx5_kvargs_ctrl *mkvlist,
@@ -35 +37 @@
-index 2c51af11c7..1bb036afeb 100644
+index 834707ea87..9179b9d9d7 100644
@@ -38 +40 @@
-@@ -1605,18 +1605,19 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
+@@ -1602,18 +1602,19 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
@@ -69 +71 @@
-@@ -1675,6 +1676,8 @@ unsupport:
+@@ -1672,6 +1673,8 @@ unsupport:


More information about the stable mailing list