Re: [PATCH net 1/2] net/sched: flag inconsistent qdisc dumps
From: Eric Dumazet
Date: Thu Jul 30 2026 - 06:58:53 EST
On Thu, Jul 30, 2026 at 12:00 PM Reshma Sreekumar <reshmaisat@xxxxxxxxx> 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.