From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet Subject: Re: [PATCH v4 2/9] bus: add device iterator Date: Wed, 21 Jun 2017 14:15:56 +0200 Message-ID: <20170621121555.GF2344@bidouze.vm.6wind.com> References: <24f6e244a99903f543925067aa52baafe10cfc84.1497999601.git.gaetan.rivet@6wind.com> <3755201.Yc0g0bYsoq@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Jan Blunck To: Thomas Monjalon Return-path: Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by dpdk.org (Postfix) with ESMTP id 18661374 for ; Wed, 21 Jun 2017 14:16:04 +0200 (CEST) Received: by mail-wr0-f169.google.com with SMTP id r103so132524048wrb.0 for ; Wed, 21 Jun 2017 05:16:04 -0700 (PDT) Content-Disposition: inline In-Reply-To: <3755201.Yc0g0bYsoq@xps> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jun 21, 2017 at 01:55:39PM +0200, Thomas Monjalon wrote: > 21/06/2017 01:29, Gaetan Rivet: > > +/** > > + * Device comparison function. > > + * > > + * @param dev > > + * Device handle. > > + * > > + * @param data > > + * Data to compare against. > > + * > > + * @return > > + * 0 if the device matches the data. > > + * !0 if the device does not match. > > + * <0 if ordering is possible and the device is lower than the data. > > + * >0 if ordering is possible and the device is greater than the data. > > + */ > > +typedef int (*rte_dev_cmp_t)(const struct rte_device *dev, const void *data); > > data is really abstract. > Maybe a comment is missing to explain that data is better specified > in bus implementations? > I'm not sure it is better specified in rte_bus though :). However, the usage can be understood there, why it exists in the first place. I think bus iterators could benefit some more explanation about the why. > Why not implement it for PCI? > I sent this series with only the patches from Jan, initially in the version he solely developed. Only afterward did I fix a few bugs, reworked a few APIs. As such, two other series complete this patchset: [dpdk-dev] [PATCH v3] pci: implement find_device bus operation http://dpdk.org/ml/archives/dev/2017-June/067485.html And [dpdk-dev] [PATCH v3 0/3] eal: complete attach / detach support http://dpdk.org/ml/archives/dev/2017-June/067516.html It might make sense to merge all three series together. They are conceptually linked very closely. The only reason I did not do so at first was because I was unsure about who would take responsibility for the attach / detach patchset, and if it had not be me I did not want to put undue responsibility of my patches on whomever would. But that point is moot now. -- Gaëtan Rivet 6WIND