* [Bug Report] KNI Module Causes Loopback Interface to Have Incorrect ifindex in Linux 5.4.46
@ 2025-04-23 5:52 nan he
2025-05-20 13:49 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [Bug Report] KNI Module Causes Loopback Interface to Have Incorrect ifindex in Linux 5.4.46
2025-04-23 5:52 [Bug Report] KNI Module Causes Loopback Interface to Have Incorrect ifindex in Linux 5.4.46 nan he
@ 2025-05-20 13:49 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2025-05-20 13:49 UTC (permalink / raw)
To: nan he; +Cc: dev
On Wed, 23 Apr 2025 13:52:39 +0800
nan he <nhe295771@gmail.com> wrote:
> 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.
KNI is no longer supported. One of the reasons was that the KNI
kernel module is not upstream and has lots of bugs.
You found one and it is unlikely to be fixed.
Please use other mechanism such as TAP or virtio-user to inject
packets into the kernel.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-20 13:49 UTC | newest]
Thread overview: 2+ messages (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
2025-05-20 13:49 ` Stephen Hemminger
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).