* [Bug Report] KNI Module Causes Loopback Interface to Have Incorrect ifindex in Linux 5.4.46
@ 2025-04-23 5:52 nan he
0 siblings, 0 replies; only message in thread
From: nan he @ 2025-04-23 5:52 UTC (permalink / raw)
To: dev
[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]
Dear DPDK Developers,
I am reporting an issue encountered in an environment running Linux kernel
version 5.4.46 with DPDK 19.11. When attempting to run Docker containers in
bridge mode, the container creation fails consistently. The kmsg indicate a
crash during the initialization of the loopback device within a new
*net_namespace*, specifically due to the loopback interface not being
assigned the expected ifindex of 1.
*Issue Description:*
During the creation of a net_namespace, the kernel initializes network
devices in a specific order. It is expected that the loopback interface is
the first to be initialized, thereby receiving an ifindex of 1. This
assumption is enforced in the kernel code, where a BUG_ON check ensures
that the loopback interface has *ifindex == 1.* However, with the DPDK KNI
module loaded, this assumption fails, resulting in a kernel panic during
container creation.
*Root Cause Analysis:*
Upon investigation, it appears that the KNI module registers its network
operations using the *register_pernet_subsys()* function. This registration
method places the KNI initialization function before the loopback device's
initialization in *pernet_list*. Consequently, when a new * net_namespace*
is created, the KNI interface is initialized before the loopback interface,
causing the KNI interface to receive ifindex 1 and the loopback interface
to receive ifindex 2. This order violates the kernel's expectation and
triggers the BUG_ON check.
*Environment Details:*
-
DPDK Version: 19.11
-
Kernel Version: 5.4.46
-
Operating System: Linux
- Architecture: x86_64
*Reproduction Steps:*
1.
Load the DPDK KNI module.
2.
Use Docker to create a new container in bridge mode.
3.
Observe the kernel panic due to the loopback interface not having ifindex
1.
*Additional Information:*
We would appreciate it if the DPDK development team could review this issue
and consider incorporating the proposed change into future releases. Please
let us know if further information or testing is required from our side.
Best regards,
[-- Attachment #2: Type: text/html, Size: 2919 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-05 12:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-23 5:52 [Bug Report] KNI Module Causes Loopback Interface to Have Incorrect ifindex in Linux 5.4.46 nan he
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).