From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v7 5/6] bus: add helper to find a bus from a device name Date: Thu, 06 Jul 2017 12:10:10 +0200 Message-ID: <2074223.j7Uj7OpmZu@xps> References: <20170705134521.GI11154@bidouze.vm.6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: =?ISO-8859-1?Q?Ga=EBtan?= Rivet , Shreyansh Jain Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 13F6E235 for ; Thu, 6 Jul 2017 12:10:11 +0200 (CEST) In-Reply-To: <20170705134521.GI11154@bidouze.vm.6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 05/07/2017 15:45, Ga=EBtan Rivet: > On Wed, Jul 05, 2017 at 07:05:40PM +0530, Shreyansh Jain wrote: > > >+struct rte_bus * > > >+rte_bus_find_by_device_name(const char *str) > > >+{ > > >+ char name[32]; > >=20 > > It is possible to use a constant here? Basically, I am not sure why '32= ' has > > been chosen - or maybe, it might remind a reader in future the reason f= or > > this value. > >=20 > > Just to clarify: is there any documented limit on bus name? Until this > > point, the name (and length) of bus was responsibility of bus driver > > implementation. eal_common_bus.c doesn't codify any limit - so, this may > > have to be advertised, even if just within the code. >=20 > I agree that this is not clear. First thing however: this is a limit on > the device name length, not bus. >=20 > This problem is fixed in [1], as a single common device name location is > defined. The problem is that it is in another patchset (even if both are > closely linked and were only separated to ease integration). >=20 > This limit was currently taken from the arbitrary limit of device in > name in the original rte_devargs for virtual devices. I think it could > be exported as a define by rte_dev.h, used there and reused in [1] to > define the new rte_devargs structure. Please check this patch which was integrated yesterday: http://dpdk.org/commit/48d8675c9cf Now you can use RTE_DEV_NAME_MAX_LEN instead of hardcoded 32.