patch 'net/mlx5: fix MPRQ stride size for headroom' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Thu Aug 10 02:10:31 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 9a2a6168fc205306b2f092d4f72ac487f87c8d4d Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev at nvidia.com>
Date: Wed, 31 May 2023 22:00:18 +0300
Subject: [PATCH] net/mlx5: fix MPRQ stride size for headroom
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit e6479f009fbd9c8e873807cc928dcf91a151aba9 ]

The space for the headroom is reserved at the end of every MPRQ stride
for the next packet. The Rx burst logic is to copy any overlapping
packet data if there is an overlap with this reserved headroom space.
But it is not possible if the headroom size is bigger than the whole
stride. Adjust the stride size to make sure the stride size is greater
than the headroom size.

Fixes: 34776af600df ("net/mlx5: fix MPRQ stride devargs adjustment")

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

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 79ccea5003..8250c94803 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2479,6 +2479,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->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 a42c70f898..6b2af87cd2 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1601,23 +1601,38 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 	} else {
 		*actual_log_stride_num = config->mprq.log_stride_num;
 	}
-	if (config->mprq.log_stride_size) {
-		/* 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;
+	/* 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));
+	} 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) {
+		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 out of range, setting default value (%u)",
-				dev->data->port_id, idx,
-				RTE_BIT32(log_def_stride_size));
+				"Port %u Rx queue %u size of a stride for Multi-Packet RQ is adjusted to match the mbuf size (%u)",
+				dev->data->port_id, idx, min_mbuf_size);
+			*actual_log_stride_size = log2above(min_mbuf_size);
 		} else {
-			*actual_log_stride_size = config->mprq.log_stride_size;
+			goto unsupport;
 		}
-	} else {
-		if (min_mbuf_size <= RTE_BIT32(log_max_stride_size))
-			*actual_log_stride_size = log2above(min_mbuf_size);
-		else
+	}
+	/* Make sure the stride size is greater than the headroom. */
+	if (RTE_BIT32(*actual_log_stride_size) < RTE_PKTMBUF_HEADROOM) {
+		if (RTE_BIT32(log_max_stride_size) > RTE_PKTMBUF_HEADROOM) {
+			DRV_LOG(WARNING,
+				"Port %u Rx queue %u size of a stride for Multi-Packet RQ is adjusted to accommodate the headroom (%u)",
+				dev->data->port_id, idx, RTE_PKTMBUF_HEADROOM);
+			*actual_log_stride_size = log2above(RTE_PKTMBUF_HEADROOM);
+		} else {
 			goto unsupport;
+		}
 	}
 	log_stride_wqe_size = *actual_log_stride_num + *actual_log_stride_size;
 	/* Check if WQE buffer size is supported by hardware. */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-08-09 21:51:21.062732700 +0800
+++ 0114-net-mlx5-fix-MPRQ-stride-size-for-headroom.patch	2023-08-09 21:51:18.284352000 +0800
@@ -1 +1 @@
-From e6479f009fbd9c8e873807cc928dcf91a151aba9 Mon Sep 17 00:00:00 2001
+From 9a2a6168fc205306b2f092d4f72ac487f87c8d4d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e6479f009fbd9c8e873807cc928dcf91a151aba9 ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index fd9b76027d..b373306f98 100644
+index 79ccea5003..8250c94803 100644
@@ -27 +29 @@
-@@ -2603,6 +2603,7 @@ mlx5_port_args_config(struct mlx5_priv *priv, struct mlx5_kvargs_ctrl *mkvlist,
+@@ -2479,6 +2479,7 @@ mlx5_port_args_config(struct mlx5_priv *priv, struct mlx5_kvargs_ctrl *mkvlist,
@@ -36 +38 @@
-index ec713009d7..8ef7860e16 100644
+index a42c70f898..6b2af87cd2 100644
@@ -39 +41 @@
-@@ -1604,23 +1604,38 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
+@@ -1601,23 +1601,38 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,


More information about the stable mailing list