From: Reshma Sreekumar <reshmaisat@gmail.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>,
netdev@vger.kernel.org
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Reshma Sreekumar <reshmaisat@gmail.com>
Subject: [PATCH net 0/2] net/sched: flag inconsistent qdisc dumps
Date: Thu, 30 Jul 2026 12:00:04 +0200 [thread overview]
Message-ID: <20260730100006.3547944-1-reshmaisat@gmail.com> (raw)
tc_dump_qdisc() walks every netdev in the netns and spans many netlink
batches on any busy host. RTNL is only held while a single batch is filled,
so the device list can change in between and the reply can miss entries --
but nothing under net/sched sets cb->seq, so NLM_F_DUMP_INTR is never raised
and userspace cannot tell a partial listing from a complete one.
rtnl_dump_ifinfo() already pairs for_each_netdev_dump() with
cb->seq = dev_base_seq and nl_dump_check_consistent(); patch 1 does the same
for the qdisc dump.
Patch 2 adds a selftest. Netlink dumps are driven by the reader, so it
unregisters a device at a known point between two batches instead of racing
against one, and a second case requires the flag to stay clear on an
undisturbed dump. It fails on net/main and passes with patch 1.
Build coverage: allmodconfig builds clean with W=1 -- vmlinux and all
modules link, no new warnings, none in net/sched. allyesconfig compiles
clean with W=1, including net/sched/sch_api.o with no diagnostics in
net/sched, but the final LD of vmlinux.o exceeds the memory of the machine
used here, so that link was not completed.
Reshma Sreekumar (2):
net/sched: flag inconsistent qdisc dumps
selftests: net: check that a disturbed qdisc dump is flagged
net/sched/sch_api.c | 16 ++-
tools/testing/selftests/net/Makefile | 1 +
.../testing/selftests/net/qdisc_dump_intr.py | 123 ++++++++++++++++++
3 files changed, 139 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/net/qdisc_dump_intr.py
base-commit: 51b093a7ba27476e1f639455f005e8d2e75390e4
--
2.43.0
next reply other threads:[~2026-07-30 10:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 10:00 Reshma Sreekumar [this message]
2026-07-30 10:00 ` [PATCH net 1/2] net/sched: flag inconsistent qdisc dumps Reshma Sreekumar
2026-07-30 10:25 ` Eric Dumazet
2026-07-31 13:49 ` Reshma Sreekumar
2026-07-30 10:00 ` [PATCH net 2/2] selftests: net: check that a disturbed qdisc dump is flagged Reshma Sreekumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260730100006.3547944-1-reshmaisat@gmail.com \
--to=reshmaisat@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.