From: Jakub Kicinski <kuba@kernel.org>
To: junjie.cao@intel.com
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, horms@kernel.org, jhs@mojatatu.com,
jiri@resnulli.us, vinicius.gomes@intel.com, shuah@kernel.org,
bestswngs@gmail.com, uladzislau.zhauniarovich@gmail.com,
hdanton@sina.com,
syzbot+19d01f6082ec61dd45b2@syzkaller.appspotmail.com,
syzbot+8785aaf121cfb2141e0d@syzkaller.appspotmail.com,
syzbot+2642f347f7309b4880dc@syzkaller.appspotmail.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net v2 3/3] selftests/tc-testing: taprio: add case for the software minimum interval
Date: Mon, 24 Aug 2026 11:53:38 -0700 [thread overview]
Message-ID: <20260824185339.2704038-1-kuba@kernel.org> (raw)
In-Reply-To: <20260820062715.278124-4-junjie.cao@intel.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
selftests/tc-testing: taprio: add case for the software minimum interval
This adds a tdc case (id f4b2) to tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json
which asserts that a pure software taprio schedule with 50000 ns entries is
rejected, since the entries are below TAPRIO_MIN_SW_INTERVAL_NS.
> diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json
> index cd19d05925e40..3fe66839f8aed 100644
> --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json
> +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json
> @@ -154,6 +154,28 @@
> "echo \"1\" > /sys/bus/netdevsim/del_device"
> ]
> },
> + {
> + "id": "f4b2",
> + "name": "Add taprio Qdisc with software interval below the minimum",
> + "category": [
> + "qdisc",
> + "taprio"
> + ],
> + "plugins": {
> + "requires": "nsPlugin"
> + },
> + "setup": [
> + "echo \"1 1 8\" > /sys/bus/netdevsim/new_device"
> + ],
> + "cmdUnderTest": "$TC qdisc add dev $ETH root handle 1: taprio num_tc 2 queues 1@0 1@1 sched-entry S 01 50000 sched-entry S 02 50000 clockid CLOCK_TAI",
> + "expExitCode": "2",
[Severity: Low]
This isn't a bug, but should there also be a companion case that pins the
other half of the rule? The kernel rule this case targets is conditional in
taprio_min_interval():
net/sched/sch_taprio.c:taprio_min_interval() {
s64 min_interval = length_to_duration(q, ETH_ZLEN);
/* Only pure software schedules arm the per-entry hrtimer. */
if (!FULL_OFFLOAD_IS_ENABLED(q->flags) &&
!TXTIME_ASSIST_IS_ENABLED(q->flags))
min_interval = max_t(s64, min_interval,
TAPRIO_MIN_SW_INTERVAL_NS);
return min_interval;
}
The new f4b2 case only covers the branch being taken. Reading the rest of
taprio.json, no case appears able to flip that branch: the flags-carrying
cases ba39, 9462, 8d92, d092, 8471, 0a85 and 3e1e all use 300000 ns
intervals with "flags 0x1", and e8a1/6a83 use 20000000 ns with "flags 0x2",
so they pass whether or not the 100 us floor is gated on the flags.
Would that mean a change making the floor unconditional, and thus rejecting
hardware-offloaded or txtime-assist schedules with sub-100 us gates, still
leaves the whole taprio.json suite reporting PASS, including f4b2?
A mirror case using "flags 0x1" with the same 50000 ns entries and
expExitCode 0 would cover the exemption. On netdevsim this looks feasible:
netdevsim has no get_link_ksettings, so taprio_set_picos_per_byte() falls
back to SPEED_10, giving picos_per_byte 800000 and
length_to_duration(ETH_ZLEN) of 48000 ns, so 50000 ns entries and the
derived 100000 ns cycle are above the unconditional floor.
> + "verifyCmd": "$TC qdisc show dev $ETH",
> + "matchPattern": "qdisc taprio 1: root refcnt",
> + "matchCount": "0",
> + "teardown": [
> + "echo \"1\" > /sys/bus/netdevsim/del_device"
> + ]
> + },
[ ... ]
prev parent reply other threads:[~2026-08-24 18:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 6:27 [PATCH net v2 0/3] net/sched: taprio: fix software schedule livelocks Junjie Cao
2026-08-20 6:27 ` [PATCH net v2 1/3] net/sched: taprio: catch up in bounded time when the schedule falls behind Junjie Cao
2026-08-24 18:53 ` Jakub Kicinski
2026-08-20 6:27 ` [PATCH net v2 2/3] net/sched: taprio: enforce a minimum interval for software schedules Junjie Cao
2026-08-24 18:53 ` Jakub Kicinski
2026-08-20 6:27 ` [PATCH net v2 3/3] selftests/tc-testing: taprio: add case for the software minimum interval Junjie Cao
2026-08-24 18:53 ` Jakub Kicinski [this message]
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=20260824185339.2704038-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=bestswngs@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hdanton@sina.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=junjie.cao@intel.com \
--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 \
--cc=syzbot+19d01f6082ec61dd45b2@syzkaller.appspotmail.com \
--cc=syzbot+2642f347f7309b4880dc@syzkaller.appspotmail.com \
--cc=syzbot+8785aaf121cfb2141e0d@syzkaller.appspotmail.com \
--cc=uladzislau.zhauniarovich@gmail.com \
--cc=vinicius.gomes@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®