From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id AB7E15F1D for ; Thu, 31 Jan 2019 16:51:17 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3263750CE; Thu, 31 Jan 2019 15:51:16 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-200.ams2.redhat.com [10.36.117.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFF2D5C23E; Thu, 31 Jan 2019 15:51:15 +0000 (UTC) From: Kevin Traynor To: Shreyansh Jain Cc: dpdk stable Date: Thu, 31 Jan 2019 15:48:55 +0000 Message-Id: <20190131154901.5383-47-ktraynor@redhat.com> In-Reply-To: <20190131154901.5383-1-ktraynor@redhat.com> References: <20190131154901.5383-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 31 Jan 2019 15:51:17 +0000 (UTC) Subject: [dpdk-stable] patch 'bus/fslmc: fix parse method for bus devices' has been queued to LTS release 18.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 15:51:18 -0000 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 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 --- 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 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@dpdk.org Signed-off-by: Shreyansh Jain ---