From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id EC48B1B525 for ; Wed, 11 Jul 2018 14:01:58 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id h9-v6so17906342wro.3 for ; Wed, 11 Jul 2018 05:01:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=4DNyoZ0zHXqaxm2Immuj2YwBJk747ZVzn0iOqegYrBY=; b=KG3CEosBoxS9clykvQfuDg8rov+bvWFvLJ9z0t+kZIQpPQto0JTkJ+W43BwKUu3ZFX Plk7GPocYd5eiScJp3KgYNhS8meztVKJLVc0nA+LEHlSTXRpHgjeO8TQ8DzyWx+PD2Ei 4qVJABVR6bPvNeckLXZb0eX9M6I5CPLnXQlkaG1dYVFSyNv8rbKNaUV4mJ1okqvEEC9H 8megIOeteWxQMPDwGMRrmsyolrIR3Sx6X31ZPraQonuaDxxtI4N4aHauIKDSHJBrtgy5 K4ftf9FKZxNJw/AfDYyo1VWD579yhFtnfuv8BO1r8FwGKxBAn6TCTgvIyzAYWF5aLMAc BneQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=4DNyoZ0zHXqaxm2Immuj2YwBJk747ZVzn0iOqegYrBY=; b=pEHbWmF9d3ImvcZgficjEtC6NQ2gjzi7mALRQvw8pxceWlsi9Fp/3JEr1Y+ttmUMGm zLHmXSkdBoxNJZMxJ5zZRLw5+WBnsxwdRVVh/dIgr4RdsL3aiP7PoQnYWQFSUfJckFMf Vgwc+VqDIg+ExwY+Ws9d8MRH8QFUFsrffLDK5NTJI2HtuM0fcVqZYSwmP7eXfKjRcXfb 4M+OP3qDytt4H0aJNF/46SyX1SKFA2qmc2gFzUjziPcR0EsX4ZGypzE3v7I7O0W2B8La Zj/d1bLmhYGMwLsvVqOMgpaWcTI6TqI057CJIitMpcr13uq+lFT92QH36A0qMjjebsEk e9yw== X-Gm-Message-State: APt69E3fJUXAfZEEf97tWvfiFdWzFSNRFGia/War0P9P+aYlw6cdxv2I wUSZJtg5hugwd/EyR3nqxqXWpfrc X-Google-Smtp-Source: AAOMgpe8ypD6SaVT+e7WYFGGxC+5/+6gzjYTDtC9GaInYD0JrjnpZ+9DtBIKhTUCb2Ww3C5O5QVmsg== X-Received: by 2002:adf:e642:: with SMTP id b2-v6mr23161234wrn.254.1531310518499; Wed, 11 Jul 2018 05:01:58 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f138-v6sm2607305wmd.13.2018.07.11.05.01.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 05:01:57 -0700 (PDT) Date: Wed, 11 Jul 2018 14:01:41 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Shreyansh Jain Cc: dev@dpdk.org Message-ID: <20180711120141.4eocuqnhphgbgrd4@bidouze.vm.6wind.com> References: <4dd95d07b484a671a2be5d65ad12a4212093ada8.1530791217.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v10 01/27] devargs: add non-variadic parsing function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2018 12:01:59 -0000 On Wed, Jul 11, 2018 at 05:16:15PM +0530, Shreyansh Jain wrote: > On Thursday 05 July 2018 05:18 PM, Gaetan Rivet wrote: > > rte_devargs_parse becomes non-variadic, > > rte_devargs_parsef becomes the variadic version, to be used to compose > > device strings. > > > > Signed-off-by: Gaetan Rivet > > --- > > drivers/net/failsafe/failsafe_args.c | 2 +- > > drivers/net/failsafe/failsafe_eal.c | 2 +- > > lib/librte_eal/common/eal_common_dev.c | 4 +- > > lib/librte_eal/common/eal_common_devargs.c | 42 ++++++++++++++++----- > > lib/librte_eal/common/include/rte_devargs.h | 40 +++++++++++++++++++- > > lib/librte_eal/rte_eal_version.map | 1 + > > lib/librte_ethdev/rte_ethdev.c | 2 +- > > 7 files changed, 76 insertions(+), 17 deletions(-) > > > > [...] > > > +__rte_experimental > > +int > > +rte_devargs_parsef(struct rte_devargs *da, const char *format, ...) > > +{ > > + va_list ap; > > + size_t len; > > + char *dev; > > + > > + if (da == NULL) > > + return -EINVAL; > > + > > + va_start(ap, format); > > + len = vsnprintf(NULL, 0, format, ap); > > + va_end(ap); > > + > > + dev = calloc(1, len + 1); > > + if (dev == NULL) { > > + fprintf(stderr, "ERROR: not enough memory to parse device\n"); > > Should RTE_LOG be used here? > Yes, actually, I think the whole rte_devargs should be changed to RTE_LOG. > > + return -ENOMEM; > > + } > > + > > + va_start(ap, format); > > + vsnprintf(dev, len, format, ap); > > + va_end(ap); > > + > > + return rte_devargs_parse(da, dev); > > +} > > + > > int __rte_experimental > > rte_devargs_insert(struct rte_devargs *da) > > { > > [...] > > Except the comment above: > > Acked-by: Shreyansh Jain -- Gaëtan Rivet 6WIND