[v2] kni: reduce interface name size

Message ID 20191115130328.25683-1-michael.pfeiffer@tu-ilmenau.de (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] kni: reduce interface name size |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Michael Pfeiffer Nov. 15, 2019, 1:03 p.m. UTC
  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 <michael.pfeiffer@tu-ilmenau.de>
---
 lib/librte_eal/linux/eal/include/rte_kni_common.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Ferruh Yigit Nov. 15, 2019, 1:30 p.m. UTC | #1
On 11/15/2019 1:03 PM, Michael Pfeiffer 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 <michael.pfeiffer@tu-ilmenau.de>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
David Marchand Nov. 19, 2019, 9:02 p.m. UTC | #2
On Fri, Nov 15, 2019 at 2:30 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 11/15/2019 1:03 PM, Michael Pfeiffer 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 <michael.pfeiffer@tu-ilmenau.de>
>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks.



--
David Marchand
  

Patch

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..b427cd56c 100644
--- a/lib/librte_eal/linux/eal/include/rte_kni_common.h
+++ b/lib/librte_eal/linux/eal/include/rte_kni_common.h
@@ -15,10 +15,10 @@ 
 #include <rte_config.h>
 #endif
 
-/**
- * KNI name is part of memzone name.
+/*
+ * KNI name is part of memzone name. Must not exceed IFNAMSIZ.
  */
-#define RTE_KNI_NAMESIZE 32
+#define RTE_KNI_NAMESIZE 16
 
 #define RTE_CACHE_LINE_MIN_SIZE 64