From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet Subject: Re: [PATCH v7 5/6] bus: add helper to find a bus from a device name Date: Thu, 6 Jul 2017 13:37:43 +0200 Message-ID: <20170706113743.GK11154@bidouze.vm.6wind.com> References: <20170705134521.GI11154@bidouze.vm.6wind.com> <2074223.j7Uj7OpmZu@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Shreyansh Jain , dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mail-wr0-f181.google.com (mail-wr0-f181.google.com [209.85.128.181]) by dpdk.org (Postfix) with ESMTP id C96DF56A1 for ; Thu, 6 Jul 2017 13:37:52 +0200 (CEST) Received: by mail-wr0-f181.google.com with SMTP id k67so25082916wrc.2 for ; Thu, 06 Jul 2017 04:37:52 -0700 (PDT) Content-Disposition: inline In-Reply-To: <2074223.j7Uj7OpmZu@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 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