[dpdk-stable] patch 'bus/fslmc: fix parse method for bus devices' has been queued to LTS release 18.11.1

Kevin Traynor ktraynor at redhat.com
Thu Jan 31 16:48:55 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.1

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

Thanks.

Kevin Traynor

---
>From f5fa62421415fb43e3605d8a54e27e606a0c777f Mon Sep 17 00:00:00 2001
From: Shreyansh Jain <shreyansh.jain at nxp.com>
Date: Fri, 11 Jan 2019 12:24:23 +0000
Subject: [PATCH] bus/fslmc: fix parse method for bus devices

[ upstream commit 68f5637bcba7ecace57e12b85d82fdeadaa58843 ]

Current code expects that bus->parse() would get a string containing
the name of the bus. That is incorrect. bus->parse() is expected
to have strings like:
  dpni.1,key=val
  dpio.2,key=val

when user passed:
  -b fslmc:dpni.1,key=val

This commit fixes this behavior.

Fixes: 50245be05d1a ("bus/fslmc: support device blacklisting")

Signed-off-by: Shreyansh Jain <shreyansh.jain at nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 89af9385a..565e0148f 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- *   Copyright 2016 NXP
+ *   Copyright 2016,2018 NXP
  *
  */
@@ -228,18 +228,14 @@ rte_fslmc_parse(const char *name, void *addr)
 {
 	uint16_t dev_id;
-	char *t_ptr;
-	char *sep = strchr(name, ':');
+	char *t_ptr = NULL, *dname = NULL;
 
-	if (strncmp(name, RTE_STR(FSLMC_BUS_NAME),
-		strlen(RTE_STR(FSLMC_BUS_NAME)))) {
-		return -EINVAL;
-	}
+	/* 'name' is expected to contain name of device, for example, dpio.1,
+	 * dpni.2, etc.
+	 */
 
-	if (!sep) {
-		DPAA2_BUS_ERR("Incorrect device name observed");
+	dname = strdup(name);
+	if (!dname)
 		return -EINVAL;
-	}
-
-	t_ptr = (char *)(sep + 1);
+	t_ptr = dname;
 
 	if (strncmp("dpni", t_ptr, 4) &&
@@ -252,5 +248,5 @@ rte_fslmc_parse(const char *name, void *addr)
 	    strncmp("dpdmai", t_ptr, 6)) {
 		DPAA2_BUS_ERR("Unknown or unsupported device");
-		return -EINVAL;
+		goto err_out;
 	}
 
@@ -258,5 +254,5 @@ rte_fslmc_parse(const char *name, void *addr)
 	if (!t_ptr) {
 		DPAA2_BUS_ERR("Incorrect device string observed (%s)", t_ptr);
-		return -EINVAL;
+		goto err_out;
 	}
 
@@ -264,10 +260,15 @@ rte_fslmc_parse(const char *name, void *addr)
 	if (sscanf(t_ptr, "%hu", &dev_id) <= 0) {
 		DPAA2_BUS_ERR("Incorrect device string observed (%s)", t_ptr);
-		return -EINVAL;
+		goto err_out;
 	}
+	free(dname);
 
 	if (addr)
-		strcpy(addr, (char *)(sep + 1));
+		strcpy(addr, name);
+
 	return 0;
+err_out:
+	free(dname);
+	return -EINVAL;
 }
 
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-01-31 15:44:06.834038607 +0000
+++ 0047-bus-fslmc-fix-parse-method-for-bus-devices.patch	2019-01-31 15:44:05.000000000 +0000
@@ -1,8 +1,10 @@
-From 68f5637bcba7ecace57e12b85d82fdeadaa58843 Mon Sep 17 00:00:00 2001
+From f5fa62421415fb43e3605d8a54e27e606a0c777f Mon Sep 17 00:00:00 2001
 From: Shreyansh Jain <shreyansh.jain at nxp.com>
 Date: Fri, 11 Jan 2019 12:24:23 +0000
 Subject: [PATCH] bus/fslmc: fix parse method for bus devices
 
+[ upstream commit 68f5637bcba7ecace57e12b85d82fdeadaa58843 ]
+
 Current code expects that bus->parse() would get a string containing
 the name of the bus. That is incorrect. bus->parse() is expected
 to have strings like:
@@ -15,7 +17,6 @@
 This commit fixes this behavior.
 
 Fixes: 50245be05d1a ("bus/fslmc: support device blacklisting")
-Cc: stable at dpdk.org
 
 Signed-off-by: Shreyansh Jain <shreyansh.jain at nxp.com>
 ---


More information about the stable mailing list