From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH v2 01/18] eal: prepend busname on legacy device declaration Date: Mon, 11 Dec 2017 19:27:17 +0530 Message-ID: <0dc86df7-a083-6b8f-bca9-52fba273e348@nxp.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: To: Gaetan Rivet Return-path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0054.outbound.protection.outlook.com [104.47.38.54]) by dpdk.org (Postfix) with ESMTP id 85CF0107A for ; Mon, 11 Dec 2017 14:43:45 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" One very quick comment: On Thursday 12 October 2017 01:51 PM, Gaetan Rivet wrote: > Legacy device options (-b, -w, --vdev) need to prepend their bus name to > user parameters for backward compatibility. > > Signed-off-by: Gaetan Rivet > --- > lib/librte_eal/common/eal_common_options.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c > index 630c9d2..d57cb5d 100644 > --- a/lib/librte_eal/common/eal_common_options.c > +++ b/lib/librte_eal/common/eal_common_options.c > @@ -143,13 +143,16 @@ static int mem_parsed; > static int core_parsed; > > static int > -eal_option_device_add(enum rte_devtype type, const char *optarg) > +eal_option_device_add(enum rte_devtype type, > + const char *busname, const char *optarg) > { > struct device_option *devopt; > size_t optlen; > int ret; > > optlen = strlen(optarg) + 1; > + if (busname != NULL) > + optlen += strlen(optarg) + 1; I think you want "optlen += strlen(busname) + 1"; > devopt = calloc(1, sizeof(*devopt) + optlen); > if (devopt == NULL) { > RTE_LOG(ERR, EAL, "Unable to allocate device option\n"); [...]