Re: [PATCH net 1/2] net/sched: flag inconsistent qdisc dumps

Eric Dumazet <[email protected]>
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <CANn89iLqLYAE_ZbK8F1HNop7nVPAR8AaMD2ojk+XuCNomJPEUg@mail.gmail.com>
On Thu, Jul 30, 2026 at 12:00 PM Reshma Sreekumar <[email protected]> wrote:
>
> tc_dump_qdisc() walks every netdev in the netns and can span many netlink
> batches.  RTNL is only held while a single batch is filled, so devices can
> be registered or unregistered in between.  Since 748bbef5fc6a ("net/sched:
> switch tc_dump_qdisc() to for_each_netdev_dump()") the walk resumes on an
> ifindex rather than a list position, but ifindexes are reused: a device
> created between two batches can be given an ifindex the dump has already
> walked past, and is then missed entirely.  Before that commit the resume
> used a position in the device list, so any unregister shifted every later
> device and silently dropped a run of qdiscs from the reply.

I dislike this patch; it will force dump operations to restart on busy netns.

Most devices are created with a new ifindex (dev_index_reserve() is
called with ifindex == 0)

Forcing a given ifindex is rather unusual.

I suggest detecting this specific use case instead of slowing down everything.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.