patch 'net/mlx5: fix devargs validation for multi-class probing' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Sun Nov 28 15:54:22 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/f22425186efbea2a330270a76baa9ce1cdef6d12

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From f22425186efbea2a330270a76baa9ce1cdef6d12 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba at nvidia.com>
Date: Thu, 25 Nov 2021 08:16:55 +0200
Subject: [PATCH] net/mlx5: fix devargs validation for multi-class probing
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 8648fa2f4688c2ef2d7991bcc3bfa20753862e8e ]

The mlx5_args function reads the devargs and checks if they are valid
for this driver and if not it returns an error.

This was normal behavior as long as all the devargs come to this driver,
but since it is possible to run several drivers together, the function
may return an error for another driver's devarg even though it is
completely valid.
In addition the function does not allow the user to know which of the
devargs is incorrect, but returns an error without printing the
unknown devarg.

This patch eliminates the error return in the case of an unknown devarg,
and prints a warning for each such devarg specifically.

Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library")

Signed-off-by: Michael Baum <michaelba at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 64 ++++++-----------------------------------
 1 file changed, 9 insertions(+), 55 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 800ca6af0a..0953561802 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1745,9 +1745,9 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
 	} else if (strcmp(MLX5_DECAP_EN, key) == 0) {
 		config->decap_en = !!tmp;
 	} else {
-		DRV_LOG(WARNING, "%s: unknown parameter", key);
-		rte_errno = EINVAL;
-		return -rte_errno;
+		DRV_LOG(WARNING,
+			"%s: unknown parameter, maybe it's for another class.",
+			key);
 	}
 	return 0;
 }
@@ -1766,71 +1766,25 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
 int
 mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)
 {
-	const char **params = (const char *[]){
-		MLX5_RXQ_CQE_COMP_EN,
-		MLX5_RXQ_PKT_PAD_EN,
-		MLX5_RX_MPRQ_EN,
-		MLX5_RX_MPRQ_LOG_STRIDE_NUM,
-		MLX5_RX_MPRQ_LOG_STRIDE_SIZE,
-		MLX5_RX_MPRQ_MAX_MEMCPY_LEN,
-		MLX5_RXQS_MIN_MPRQ,
-		MLX5_TXQ_INLINE,
-		MLX5_TXQ_INLINE_MIN,
-		MLX5_TXQ_INLINE_MAX,
-		MLX5_TXQ_INLINE_MPW,
-		MLX5_TXQS_MIN_INLINE,
-		MLX5_TXQS_MAX_VEC,
-		MLX5_TXQ_MPW_EN,
-		MLX5_TXQ_MPW_HDR_DSEG_EN,
-		MLX5_TXQ_MAX_INLINE_LEN,
-		MLX5_TX_DB_NC,
-		MLX5_TX_PP,
-		MLX5_TX_SKEW,
-		MLX5_TX_VEC_EN,
-		MLX5_RX_VEC_EN,
-		MLX5_L3_VXLAN_EN,
-		MLX5_VF_NL_EN,
-		MLX5_DV_ESW_EN,
-		MLX5_DV_FLOW_EN,
-		MLX5_DV_XMETA_EN,
-		MLX5_LACP_BY_USER,
-		MLX5_MR_EXT_MEMSEG_EN,
-		MLX5_REPRESENTOR,
-		MLX5_MAX_DUMP_FILES_NUM,
-		MLX5_LRO_TIMEOUT_USEC,
-		MLX5_CLASS_ARG_NAME,
-		MLX5_HP_BUF_SIZE,
-		MLX5_RECLAIM_MEM,
-		MLX5_SYS_MEM_EN,
-		MLX5_DECAP_EN,
-		NULL,
-	};
 	struct rte_kvargs *kvlist;
 	int ret = 0;
-	int i;
 
 	if (devargs == NULL)
 		return 0;
 	/* Following UGLY cast is done to pass checkpatch. */
-	kvlist = rte_kvargs_parse(devargs->args, params);
+	kvlist = rte_kvargs_parse(devargs->args, NULL);
 	if (kvlist == NULL) {
 		rte_errno = EINVAL;
 		return -rte_errno;
 	}
 	/* Process parameters. */
-	for (i = 0; (params[i] != NULL); ++i) {
-		if (rte_kvargs_count(kvlist, params[i])) {
-			ret = rte_kvargs_process(kvlist, params[i],
-						 mlx5_args_check, config);
-			if (ret) {
-				rte_errno = EINVAL;
-				rte_kvargs_free(kvlist);
-				return -rte_errno;
-			}
-		}
+	ret = rte_kvargs_process(kvlist, NULL, mlx5_args_check, config);
+	if (ret) {
+		rte_errno = EINVAL;
+		ret = -rte_errno;
 	}
 	rte_kvargs_free(kvlist);
-	return 0;
+	return ret;
 }
 
 /**
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-28 22:41:07.236902258 +0800
+++ 0078-net-mlx5-fix-devargs-validation-for-multi-class-prob.patch	2021-11-28 22:41:03.560203302 +0800
@@ -1 +1 @@
-From 8648fa2f4688c2ef2d7991bcc3bfa20753862e8e Mon Sep 17 00:00:00 2001
+From f22425186efbea2a330270a76baa9ce1cdef6d12 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8648fa2f4688c2ef2d7991bcc3bfa20753862e8e ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -26,2 +28,2 @@
- drivers/net/mlx5/mlx5.c | 68 ++++++-----------------------------------
- 1 file changed, 9 insertions(+), 59 deletions(-)
+ drivers/net/mlx5/mlx5.c | 64 ++++++-----------------------------------
+ 1 file changed, 9 insertions(+), 55 deletions(-)
@@ -30 +32 @@
-index 4e04817d11..aa5f313c1a 100644
+index 800ca6af0a..0953561802 100644
@@ -33,3 +35,3 @@
-@@ -1975,9 +1975,9 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
- 		config->std_delay_drop = !!(tmp & MLX5_DELAY_DROP_STANDARD);
- 		config->hp_delay_drop = !!(tmp & MLX5_DELAY_DROP_HAIRPIN);
+@@ -1745,9 +1745,9 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
+ 	} else if (strcmp(MLX5_DECAP_EN, key) == 0) {
+ 		config->decap_en = !!tmp;
@@ -46 +48 @@
-@@ -1996,75 +1996,25 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
+@@ -1766,71 +1766,25 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
@@ -51 +52,0 @@
--		MLX5_DRIVER_KEY,
@@ -83 +84 @@
--		RTE_DEVARGS_KEY_CLASS,
+-		MLX5_CLASS_ARG_NAME,
@@ -88,3 +88,0 @@
--		MLX5_ALLOW_DUPLICATE_PATTERN,
--		MLX5_MR_MEMPOOL_REG_EN,
--		MLX5_DELAY_DROP,


More information about the stable mailing list