From: Jakub Kicinski <kuba@kernel.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, horms@kernel.org,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next v3] selftests/net: convert so_txtime to drv-net
Date: Thu, 9 Apr 2026 18:50:07 -0700 [thread overview]
Message-ID: <20260409185007.516a0563@kernel.org> (raw)
In-Reply-To: <willemdebruijn.kernel.1b750e4c127c7@gmail.com>
On Thu, 09 Apr 2026 11:01:49 -0400 Willem de Bruijn wrote:
> > Alternatively could record the root qdisc at the start of the test and
> > restore that.
>
> This should work:
>
> def main() -> None:
> """Boilerplate ksft main."""
> with NetDrvEpEnv(__file__) as cfg:
> + # Record original root qdisc
> + cmd_obj = cmd((f"tc -j qdisc show dev {cfg.ifname} root"))
> + qdisc_root = json.loads(cmd_obj.stdout)[0].get("kind", None)
I don't like doing setup in main() TBH. It can well fail and no KTAP
will be produced. Breaking all the tracking and stability-based
filtering. Not sure if it's still the case but for a very long time
not all tc qdiscs supported JSON for example.
> ksft_run([test_so_txtime_mono, test_so_txtime_etf], args=(cfg,))
> +
> + # Restore original root qdisc. If mq, populate with default_qdisc nodes
> + if (qdisc_root):
> + cmd(f"tc qdisc replace dev {cfg.ifname} root {qdisc_root}")
> ksft_exit()
>
>
> Do we want to add a tc command similar to ip, bpftool, etc.
Yes, we can wrap it if it outputs json.
prev parent reply other threads:[~2026-04-10 1:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 2:49 [PATCH net-next v3] selftests/net: convert so_txtime to drv-net Willem de Bruijn
2026-04-08 2:15 ` Jakub Kicinski
2026-04-09 3:10 ` Willem de Bruijn
2026-04-09 15:01 ` Willem de Bruijn
2026-04-10 1:50 ` 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=20260409185007.516a0563@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.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 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.