[dpdk-stable] patch 'net/bnxt: check kvargs parsing' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:00:44 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/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/34972cfd96876dba2932ccf2565d5a9a88fd7fc1

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 34972cfd96876dba2932ccf2565d5a9a88fd7fc1 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde at broadcom.com>
Date: Tue, 16 Mar 2021 18:08:40 -0700
Subject: [PATCH] net/bnxt: check kvargs parsing
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 29ce7059e8e7307ac27ff94e7a46035f38d3f97e ]

Check return value of rte_kvargs_process()

Coverity issue: 357765
Fixes: ba404aacc5cf ("net/bnxt: set maximum flow count")
Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats")
Fixes: 7b0940653720 ("net/bnxt: support host memory based TruFlow")

Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b719cd74c4..e97a3ab8f6 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -5239,40 +5239,49 @@ bnxt_parse_devarg_rep_fc_f2r(__rte_unused const char *key,
 	return 0;
 }
 
-static void
+static int
 bnxt_parse_dev_args(struct bnxt *bp, struct rte_devargs *devargs)
 {
 	struct rte_kvargs *kvlist;
+	int ret;
 
 	if (devargs == NULL)
-		return;
+		return 0;
 
 	kvlist = rte_kvargs_parse(devargs->args, bnxt_dev_args);
 	if (kvlist == NULL)
-		return;
+		return -EINVAL;
 
 	/*
 	 * Handler for "truflow" devarg.
 	 * Invoked as for ex: "-a 0000:00:0d.0,host-based-truflow=1"
 	 */
-	rte_kvargs_process(kvlist, BNXT_DEVARG_TRUFLOW,
-			   bnxt_parse_devarg_truflow, bp);
+	ret = rte_kvargs_process(kvlist, BNXT_DEVARG_TRUFLOW,
+				 bnxt_parse_devarg_truflow, bp);
+	if (ret)
+		goto err;
 
 	/*
 	 * Handler for "flow_xstat" devarg.
 	 * Invoked as for ex: "-a 0000:00:0d.0,flow_xstat=1"
 	 */
-	rte_kvargs_process(kvlist, BNXT_DEVARG_FLOW_XSTAT,
-			   bnxt_parse_devarg_flow_xstat, bp);
+	ret = rte_kvargs_process(kvlist, BNXT_DEVARG_FLOW_XSTAT,
+				 bnxt_parse_devarg_flow_xstat, bp);
+	if (ret)
+		goto err;
 
 	/*
 	 * Handler for "max_num_kflows" devarg.
 	 * Invoked as for ex: "-a 000:00:0d.0,max_num_kflows=32"
 	 */
-	rte_kvargs_process(kvlist, BNXT_DEVARG_MAX_NUM_KFLOWS,
-			   bnxt_parse_devarg_max_num_kflows, bp);
+	ret = rte_kvargs_process(kvlist, BNXT_DEVARG_MAX_NUM_KFLOWS,
+				 bnxt_parse_devarg_max_num_kflows, bp);
+	if (ret)
+		goto err;
 
+err:
 	rte_kvargs_free(kvlist);
+	return ret;
 }
 
 static int bnxt_alloc_switch_domain(struct bnxt *bp)
@@ -5407,7 +5416,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
 	bp = eth_dev->data->dev_private;
 
 	/* Parse dev arguments passed on when starting the DPDK application. */
-	bnxt_parse_dev_args(bp, pci_dev->device.devargs);
+	rc = bnxt_parse_dev_args(bp, pci_dev->device.devargs);
+	if (rc)
+		goto error_free;
 
 	rc = bnxt_drv_init(eth_dev);
 	if (rc)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:29.077460000 +0800
+++ 0096-net-bnxt-check-kvargs-parsing.patch	2021-05-10 23:59:26.460000000 +0800
@@ -1 +1 @@
-From 29ce7059e8e7307ac27ff94e7a46035f38d3f97e Mon Sep 17 00:00:00 2001
+From 34972cfd96876dba2932ccf2565d5a9a88fd7fc1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 29ce7059e8e7307ac27ff94e7a46035f38d3f97e ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 646cc94bd8..372475231d 100644
+index b719cd74c4..e97a3ab8f6 100644
@@ -24 +26 @@
-@@ -5484,40 +5484,49 @@ bnxt_parse_devarg_rep_fc_f2r(__rte_unused const char *key,
+@@ -5239,40 +5239,49 @@ bnxt_parse_devarg_rep_fc_f2r(__rte_unused const char *key,
@@ -83 +85 @@
-@@ -5652,7 +5661,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
+@@ -5407,7 +5416,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)


More information about the stable mailing list