[dpdk-dev] [PATCH v7 5/6] bus: add helper to find a bus from a device name

Gaëtan Rivet gaetan.rivet at 6wind.com
Thu Jul 6 13:37:43 CEST 2017


On Thu, Jul 06, 2017 at 12:10:10PM +0200, Thomas Monjalon wrote:
> 05/07/2017 15:45, Gaëtan 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];
> > > 
> > > 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 for
> > > this value.
> > > 
> > > 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.
> > 
> > I agree that this is not clear. First thing however: this is a limit on
> > the device name length, not bus.
> > 
> > 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).
> > 
> > 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.
> 

Yes I just saw that while rebasing, it's exactly what I needed. It will
be in the next version.

-- 
Gaëtan Rivet
6WIND


More information about the dev mailing list