From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C0D7E9E3 for ; Mon, 26 Jun 2017 18:20:42 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2017 09:20:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,396,1493708400"; d="scan'208";a="278772932" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.28]) by fmsmga004.fm.intel.com with SMTP; 26 Jun 2017 09:20:39 -0700 Received: by (sSMTP sendmail emulation); Mon, 26 Jun 2017 17:20:39 +0100 Date: Mon, 26 Jun 2017 17:20:37 +0100 From: Bruce Richardson To: Gaetan Rivet Cc: dev@dpdk.org, Jan Blunck Message-ID: <20170626162037.GB101992@bricha3-MOBL3.ger.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.8.1 (2017-04-11) Subject: Re: [dpdk-dev] [PATCH v5 02/12] bus: add device iterator method 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: Mon, 26 Jun 2017 16:20:43 -0000 On Mon, Jun 26, 2017 at 02:22:00AM +0200, Gaetan Rivet wrote: > From: Jan Blunck > > Signed-off-by: Jan Blunck > Signed-off-by: Gaetan Rivet > --- > lib/librte_eal/common/include/rte_bus.h | 19 +++++++++++++++++++ > lib/librte_eal/common/include/rte_dev.h | 21 +++++++++++++++++++++ > 2 files changed, 40 insertions(+) > > diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h > index ecf839b..5efb76e 100644 > --- a/lib/librte_eal/common/include/rte_bus.h > +++ b/lib/librte_eal/common/include/rte_bus.h > @@ -82,6 +82,24 @@ typedef int (*rte_bus_scan_t)(void); > typedef int (*rte_bus_probe_t)(void); > > /** > + * Device iterator to find a device on a bus. > + * > + * This function returns an rte_device if one of those held by the bus > + * matches the data passed as parameter. > + * > + * @param cmp > + * Comparison function. > + * > + * @param data > + * Data to compare each device against. > + * > + * @return > + * The first device matching the data, NULL if none exists. > + */ > +typedef struct rte_device * (*rte_bus_find_device_t)(rte_dev_cmp_t cmp, > + const void *data); > + > +/** The bus find function takes a third, start, parameter. Is it worthwhile including such a parameter here, for consistency sake if nothing else? Otherwise: Acked-by: Bruce Richardson