All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 netdev@vger.kernel.org
Cc: davem@davemloft.net,  kuba@kernel.org,  edumazet@google.com,
	 pabeni@redhat.com,  horms@kernel.org,
	 linux-kselftest@vger.kernel.org,  shuah@kernel.org,
	 Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next v4] selftests/net: convert so_txtime to drv-net
Date: Thu, 09 Apr 2026 15:10:10 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.b23e27d8b455@gmail.com> (raw)
In-Reply-To: <20260409164238.661091-1-willemdebruijn.kernel@gmail.com>

Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
> 
> In preparation for extending to pacing hardware offload, convert the
> so_txtime.sh test to a drv-net test that can be run against netdevsim
> and real hardware.
> 
> Also update so_txtime.c to not exit on first failure, but run to
> completion and report exit code there. This helps with debugging
> unexpected results, especially when processing multiple packets,
> as in the "reverse_order" testcase.
> 
> Signed-off-by: Willem de Bruijn <willemb@google.com>

> +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)
> +
> +        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):

I evidently couldn't resist a touch up after running through pylint.

Unnecessary parentheses. Only a warn. But I can resubmit irrespective
of other concerns.

Again, could add a tc helper (in a separate patch) to hide some of the
open coded ugliness too.

> +            cmd(f"tc qdisc replace dev {cfg.ifname} root {qdisc_root}")
> +    ksft_exit()

      reply	other threads:[~2026-04-09 19:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 16:40 [PATCH net-next v4] selftests/net: convert so_txtime to drv-net Willem de Bruijn
2026-04-09 19:10 ` Willem de Bruijn [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=willemdebruijn.kernel.b23e27d8b455@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.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.