From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id EA8EF2935 for ; Tue, 4 Jul 2017 03:35:27 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id i127so123305723wma.0 for ; Mon, 03 Jul 2017 18:35:27 -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=gf70a2yhg4aVv636ZKa9rQdQGvIxh6ZGWVEbKj1b6xA=; b=vltutfZlO3fuA03HlxswUC9EWePaz0JRLI3j9elfIjeHTQihAC8hGwUVhQVDJ5L8R9 V1YGp2TT5F7AKmgZD3iHq/T/5b8GOzNxDADTSSv6+Ky3+EAYlJIAfJ1NsZAA81oZpQFn UrGCTEZwYrDQJiJBkt8sjjN7v4Z4e0euDLl6uh09uwnefhgZ4sEPb7zFzcvMbNWXH0ZN 6EHvrHS3wcEA/zqrDYJs6XOhD80BIf+U6iO3RcH6pZGaEzTv0l185Ray26qiEP5hLooR FztaMc/7JwA1EHOMj8bdgkBeWJpNoORh3ZDaQycjkEn9qieCQ2Dfgp0lqFeW0OCVTTDI cL7A== 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=gf70a2yhg4aVv636ZKa9rQdQGvIxh6ZGWVEbKj1b6xA=; b=J6ueOKlBPFkCvK/59iQPa8vGRQn9yLnHSiB5kQr5zFfN0pN/qmt6FegC+ieA4TYXmL lpG0Wzi3sbSZG5Gnf9im3XeOKT/FneMk21XPUTQ0rZfT+OUH5VXpLMK1zKkXlS6W07ax HyBMjYTfRMw4ouvb4cdZqRg8+qP+POh+Br3YH+Z0fIH+Txgz0JDG/1RF1iTFAXq2wm60 YpOOLGxi3nPAeDJ1faEU/+4BAzJV73qi1PoNyBDK76IBT7BH/SCyuIjY+GWorE2gqPQI 02pMdvCBjozqRTCg/1VDZnKPrIVpbWenTo3q46Yp7xuM7/zLcp2bZ1drJ6lrg9gGk+TM WPrA== X-Gm-Message-State: AIVw113+QwfNo349NcoCUbWMRAlAGrMGiSi7A9gZH/x3vrZ+QbAWGfa9 X0H91EcH/9ys88KT X-Received: by 10.28.172.4 with SMTP id v4mr17263457wme.72.1499132126518; Mon, 03 Jul 2017 18:35:26 -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 m73sm8433152wmi.25.2017.07.03.18.35.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 18:35:25 -0700 (PDT) Date: Tue, 4 Jul 2017 03:35:17 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Jan Blunck Cc: dev Message-ID: <20170704013517.GB11154@bidouze.vm.6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v5 2/7] bus: introduce parsing functionality 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: Tue, 04 Jul 2017 01:35:28 -0000 On Tue, Jun 27, 2017 at 09:26:20PM +0200, Jan Blunck wrote: > On Wed, Jun 21, 2017 at 1:30 AM, Gaetan Rivet wrote: > > This operation can be used either to validate that a device > > representation can be understood by a bus, as well as store the resulting > > specialized device representation in any format determined by the bus. > > > > Again, I don't think this makes sense to have. Also there is no user > for this as far as I can see. The bus specific device representation > should come from the scan function instead of this. > > I think it makes sense that scanning would store this representation yes. The issue is that it requires another rte_bus_scan API evolution, which is beyond this patchset. Keep in mind that I was bound when writing this to follow the existing API. I agree that some cleanup could come up in the EAL, but it cannot all happen at once. These first steps (generic devargs / vdev & PCI move to drivers/bus) serve to trim the EAL before these changes. > > Signed-off-by: Gaetan Rivet > > --- > > lib/librte_eal/common/include/rte_bus.h | 21 +++++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > > diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h > > index b220299..05503ea 100644 > > --- a/lib/librte_eal/common/include/rte_bus.h > > +++ b/lib/librte_eal/common/include/rte_bus.h > > @@ -117,6 +117,26 @@ typedef struct rte_device * (*rte_bus_plug_t)(struct rte_devargs *da); > > typedef int (*rte_bus_unplug_t)(struct rte_device *dev); > > > > /** > > + * Bus specific parsing function. > > + * Validates the syntax used in the textual representation of a device, > > + * If the syntax is valid and ``addr`` is not NULL, writes the bus-specific > > + * device representation to ``addr``. > > + * > > + * @param[in] name > > + * device textual description > > + * > > + * @param[out] addr > > + * device information location address, into which parsed info > > + * should be written. If NULL, nothing should be written, which > > + * is not an error. > > + * > > + * @return > > + * 0 if parsing was successful. > > + * !0 for any error. > > + */ > > +typedef int (*rte_bus_parse_t)(const char *name, void *addr); > > + > > +/** > > * A structure describing a generic bus. > > */ > > struct rte_bus { > > @@ -127,6 +147,7 @@ struct rte_bus { > > rte_bus_find_device_t find_device; /**< Find device on bus */ > > rte_bus_plug_t plug; /**< Probe single device for drivers */ > > rte_bus_unplug_t unplug; /**< Remove single device from driver */ > > + rte_bus_parse_t parse; /**< Parse a device name */ > > }; > > > > /** > > -- > > 2.1.4 > > -- Gaëtan Rivet 6WIND