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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 15 12:45:15 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.10

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/17/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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/10bc79a8df54f88b0b0c6a6e72f286e4888d2f02

Thanks.

Luca Boccassi

---
>From 10bc79a8df54f88b0b0c6a6e72f286e4888d2f02 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

[ 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/linux/mlx5_os.c |  2 +-
 drivers/net/mlx5/mlx5_rxq.c      | 25 ++++++++++++++-----------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index ab69ee21ad..ed6bfc892d 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1202,7 +1202,7 @@ err_secondary:
 	config->mprq.log_min_stride_wqe_size =
 			MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE;
 	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;
 	if (config->devx) {
 		config->mprq.log_min_stride_wqe_size =
 				config->hca_attr.log_min_stride_wqe_sz;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 4a8fc8721d..7ee0807f15 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1447,18 +1447,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)",
@@ -1517,6 +1518,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.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-11-15 11:44:14.292793189 +0000
+++ 0016-net-mlx5-fix-MPRQ-stride-size-check.patch	2023-11-15 11:44:13.622388592 +0000
@@ -1 +1 @@
-From fdee0f1b30ae8dfc431465878aae5295372cca6f Mon Sep 17 00:00:00 2001
+From 10bc79a8df54f88b0b0c6a6e72f286e4888d2f02 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fdee0f1b30ae8dfc431465878aae5295372cca6f ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -17,2 +18,2 @@
- drivers/net/mlx5/mlx5.c     |  2 +-
- drivers/net/mlx5/mlx5_rxq.c | 25 ++++++++++++++-----------
+ drivers/net/mlx5/linux/mlx5_os.c |  2 +-
+ drivers/net/mlx5/mlx5_rxq.c      | 25 ++++++++++++++-----------
@@ -21,7 +22,7 @@
-diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
-index d6cb0d1c8a..3a182de248 100644
---- a/drivers/net/mlx5/mlx5.c
-+++ b/drivers/net/mlx5/mlx5.c
-@@ -2709,7 +2709,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;
+diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
+index ab69ee21ad..ed6bfc892d 100644
+--- a/drivers/net/mlx5/linux/mlx5_os.c
++++ b/drivers/net/mlx5/linux/mlx5_os.c
+@@ -1202,7 +1202,7 @@ err_secondary:
+ 	config->mprq.log_min_stride_wqe_size =
+ 			MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE;
@@ -31,3 +32,3 @@
- 	config->log_hp_size = MLX5_ARG_UNSET;
- 	config->std_delay_drop = 0;
- 	config->hp_delay_drop = 0;
+ 	if (config->devx) {
+ 		config->mprq.log_min_stride_wqe_size =
+ 				config->hca_attr.log_min_stride_wqe_sz;
@@ -35 +36 @@
-index 2c51af11c7..1bb036afeb 100644
+index 4a8fc8721d..7ee0807f15 100644
@@ -38 +39 @@
-@@ -1605,18 +1605,19 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
+@@ -1447,18 +1447,19 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
@@ -69 +70 @@
-@@ -1675,6 +1676,8 @@ unsupport:
+@@ -1517,6 +1518,8 @@ unsupport:


More information about the stable mailing list