From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 955BE2BE1 for ; Tue, 27 Jun 2017 18:18:29 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2017 09:18:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,402,1493708400"; d="scan'208";a="1145308683" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.28]) by orsmga001.jf.intel.com with SMTP; 27 Jun 2017 09:18:26 -0700 Received: by (sSMTP sendmail emulation); Tue, 27 Jun 2017 17:18:25 +0100 Date: Tue, 27 Jun 2017 17:18:25 +0100 From: Bruce Richardson To: Gaetan Rivet Cc: dev@dpdk.org Message-ID: <20170627161825.GE9796@bricha3-MOBL3.ger.corp.intel.com> References: <519fc66238ba3ee80b44e63547d105ca7689db16.1497999826.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <519fc66238ba3ee80b44e63547d105ca7689db16.1497999826.git.gaetan.rivet@6wind.com> 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 4/7] pci: implement parse bus operation 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, 27 Jun 2017 16:18:30 -0000 On Wed, Jun 21, 2017 at 01:30:33AM +0200, Gaetan Rivet wrote: > Signed-off-by: Gaetan Rivet > --- > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 7 +++++++ > lib/librte_eal/common/eal_common_bus.c | 16 ++++++++++++++++ > lib/librte_eal/common/eal_common_pci.c | 19 +++++++++++++++++++ > lib/librte_eal/common/include/rte_bus.h | 14 ++++++++++++++ > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 7 +++++++ > 5 files changed, 63 insertions(+) > > diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > index 150b0f7..3517d74 100644 > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > @@ -197,3 +197,10 @@ DPDK_17.05 { > vfio_get_group_no; > > } DPDK_17.02; > + > +DPDK_17.08 { > + global: > + > + rte_bus_from_name; > + > +} DPDK_17.05; > diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c > index b6bf57e..e69ce38 100644 > --- a/lib/librte_eal/common/eal_common_bus.c > +++ b/lib/librte_eal/common/eal_common_bus.c > @@ -215,3 +215,19 @@ rte_bus_find_device(const struct rte_device *start, > } > return dev; > } > + > +static int > +bus_cmp_name(const struct rte_bus *bus, const void *_name) > +{ > + const char *name = _name; > + > + return strncmp(bus->name, name, > + strlen(bus->name)); > +} > + > +/* find a bus by its name */ > +struct rte_bus * > +rte_bus_from_name(const char *str) > +{ > + return rte_bus_find(bus_cmp_name, str, NULL); > +} I think the rte_bus_from_name changes should go in a separate patch, as they are not part of the PCI changes. Content-wise, it looks good though, so keep my ack on both patches if split. Acked-by: Bruce Richardson