From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A837AA04C2; Fri, 15 Nov 2019 13:52:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7DA122C15; Fri, 15 Nov 2019 13:52:32 +0100 (CET) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by dpdk.org (Postfix) with ESMTP id 437972C08 for ; Fri, 15 Nov 2019 13:52:31 +0100 (CET) Received: from tywin.prakinf.tu-ilmenau.de (unknown [141.24.212.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 0FFBA58006E; Fri, 15 Nov 2019 13:52:31 +0100 (CET) Message-ID: <4504f8b60ae436a0c8db4bd1a533229dcef9518e.camel@tu-ilmenau.de> From: Michael Pfeiffer To: Ferruh Yigit , Igor Ryzhov Cc: dev Date: Fri, 15 Nov 2019 13:52:30 +0100 In-Reply-To: <9944f8f7-34f1-1f65-9580-2b1af93ec294@intel.com> References: <20191115114107.30737-1-michael.pfeiffer@tu-ilmenau.de> <9944f8f7-34f1-1f65-9580-2b1af93ec294@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] kni: reduce interface name size 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ferruh, On Fri, 2019-11-15 at 12:49 +0000, Ferruh Yigit wrote: > On 11/15/2019 12:43 PM, Michael Pfeiffer wrote: > > Hi Igor, > > you're right, RTE_KNI_NAMESIZE == IFNAMSIZ is the intention. > > However, > > to my understanding linux/if.h (where IFNAMSIZ is defined) is only > > included when building kernel code. I thought maybe this was > > intentional to keep rte_kni_common.h free of Linux kernel > > dependencies > > (when building userland code). > > > > In practice, it probably won't matter, as the KNI kernel module is > > available for Linux only at the moment. I will therefore gladly > > change > > this to IFNAMSIZ if you and Ferruh think this is the way to go. > > I think better to not add dependency to userland, and I don't expect > IFNAMSIZ > changing in kernel side, so safe to keep hardcoded value, > only perhaps a simple /* IFNAMSIZ */ comment can be added to > highlight the > relation? perfect, I will update the patch accordingly. Regards Michael > > Regards > > Michael > > > > On Fri, 2019-11-15 at 15:30 +0300, Igor Ryzhov wrote: > > > Hi Michael, > > > > > > Isn't it better to set it to IFNAMSIZ instead of 16? > > > > > > Best regards, > > > Igot > > > > > > On Fri, Nov 15, 2019 at 2:41 PM Michael Pfeiffer < > > > michael.pfeiffer@tu-ilmenau.de> wrote: > > > > > > > The name in rte_kni_device_info is passed to the kernel, which > > > > allows > > > > interface names with at most 16 bytes (IFNAMSIZ). rte_kni_alloc > > > > with a > > > > longer name currently trigger a kernel BUG in alloc_netdev_mqs > > > > in > > > > net/core/dev.c. Reduce RTE_KNI_NAMESIZE to prevent this > > > > situation. > > > > > > > > Signed-off-by: Michael Pfeiffer > > > > > > > > --- > > > > lib/librte_eal/linux/eal/include/rte_kni_common.h | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/lib/librte_eal/linux/eal/include/rte_kni_common.h > > > > b/lib/librte_eal/linux/eal/include/rte_kni_common.h > > > > index 46f75a710..59339271b 100644 > > > > --- a/lib/librte_eal/linux/eal/include/rte_kni_common.h > > > > +++ b/lib/librte_eal/linux/eal/include/rte_kni_common.h > > > > @@ -18,7 +18,7 @@ > > > > /** > > > > * KNI name is part of memzone name. > > > > */ > > > > -#define RTE_KNI_NAMESIZE 32 > > > > +#define RTE_KNI_NAMESIZE 16 > > > > > > > > #define RTE_CACHE_LINE_MIN_SIZE 64 > > > > > > > > -- > > > > 2.20.1 > > > > > > > > -- Michael Pfeiffer Technische Universität Ilmenau Fakultät für Informatik und Automatisierung Fachgebiet Telematik / Rechnernetze E-Mail: michael.pfeiffer@tu-ilmenau.de Telefon: +49 3677 69-4854 Web: https://www.tu-ilmenau.de/telematik/mitarbeiter/michael-pfeiffer/