Netdev List
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: netdev-bot+sashiko@kernel.org,  willemdebruijn.kernel@gmail.com
Cc: netdev@vger.kernel.org,  davem@davemloft.net,  kuba@kernel.org,
	 edumazet@google.com,  pabeni@redhat.com,  horms@kernel.org,
	 andrew+netdev@lunn.ch,  willemb@google.com
Subject: Re: [PATCH net-next v9 6/7] selftests: drv-net: in so_txtime tell apart sw from hw pacing
Date: Fri, 11 Sep 2026 20:47:23 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.2e348176f4860@gmail.com> (raw)
In-Reply-To: <178914679853.219967.10930030898097751336@kernel.org>

netdev-bot+sashiko@ wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider:
> 
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
> 
> - [Medium] `-H` is documented in usage() as 'verify hardware offload
>   (tx)' and the commit message claims it tells software apart from…
> 
> --
> 
> selftests: drv-net: in so_txtime tell apart sw from hw pacing
> 
> This adds a '-H' flag to so_txtime.c that enables SO_TIMESTAMPING with
> SOF_TIMESTAMPING_TX_SOFTWARE, and flags an error if the software transmit
> timestamp is more than cfg_variance_us after the send start time.  It also
> extends the errqueue polling deadline by cfg_variance_us and sorts the
> getopt string and usage text alphabetically.
> 
> > diff --git a/tools/testing/selftests/drivers/net/so_txtime.c b/tools/testing/selftests/drivers/net/so_txtime.c
> > index f6f3253ed1748..9ebe9f91227c7 100644
> > --- a/tools/testing/selftests/drivers/net/so_txtime.c
> > +++ b/tools/testing/selftests/drivers/net/so_txtime.c
> 
> [ ... ]
> 
> > @@ -191,12 +193,32 @@ static int do_recv_errqueue_txtime(struct sock_extended_err *err,
> >  	return 1;
> >  }
> >  
> > -static int do_recv_errqueue(int fdt)
> > +static int do_recv_errqueue_timestamping(struct scm_timestamping *tss)
> > +{
> > +	int64_t ts;
> > +
> > +	ts = tss->ts[0].tv_sec * 1000ULL * 1000 * 1000;
> > +	ts += tss->ts[0].tv_nsec;
> > +	ts -= glob_tstart_real;
> > +	ts /= 1000;
> > +
> > +	if (ts > cfg_variance_us) {
> > +		fprintf(stderr, "sw delay %" PRId64 "us exceeds bounds\n", ts);
> > +		if (!cfg_machine_slow)
> > +			errors++;
> > +	}
> > +
> > +	return 1;
> > +}
> 
> [Severity: Medium]
> 
> Can this check actually tell software pacing apart from hardware pacing for
> every workload the next patch runs with '-H'?

Key here is "for every workload".

Yes, passing -H is superfluous for the non-paced tests.

No, that is not worth complicating the test to add a branch.
 
> The only positive criterion here is that the software transmit timestamp
> lands within cfg_variance_us (8000 us) of glob_tstart_real.  For a request
> with no delay or a negative delay there is no pacing interval to observe at
> all.  do_send_one() does not even attach SCM_TXTIME when delay_us is
> negative:
> 
> 	if (ts->delay_us >= 0) {
> 		...
> 		tdeliver = glob_tstart + ts->delay_us * 1000;
> 		...
> 		cm->cmsg_type = SCM_TXTIME;
> 
> So for the 'a,-1' and 'a,0' variants that the follow-up patch passes '-H'
> to, ts comes out near 0 and the ts > cfg_variance_us test can never fire,
> whether the transmit was hardware paced, software paced, or not paced at
> all.  Would it make sense to skip or reject '-H' when the requested delay
> is not positive, so those variants do not report a pass without having
> verified anything?
> 
> For the 10 ms variants there are only 2 ms between the requested delay and


  reply	other threads:[~2026-09-12  0:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 17:10 [PATCH net-next v9 0/7] hardware pacing offload Willem de Bruijn
2026-09-10 17:10 ` [PATCH net-next v9 1/7] net: rtnetlink: add pacing_offload attribute to net_device Willem de Bruijn
2026-09-11 17:13   ` netdev-bot+sashiko
2026-09-12  0:25     ` Willem de Bruijn
2026-09-10 17:10 ` [PATCH net-next v9 2/7] net_sched: sch_fq: check device pacing offload Willem de Bruijn
2026-09-11 17:13   ` netdev-bot+sashiko
2026-09-12  0:33     ` Willem de Bruijn
2026-09-10 17:10 ` [PATCH net-next v9 3/7] net_sched: sch_fq: clear past skb->tstamp if offloading pacing Willem de Bruijn
2026-09-11 17:13   ` netdev-bot+sashiko
2026-09-12  0:36     ` Willem de Bruijn
2026-09-10 17:10 ` [PATCH net-next v9 4/7] idpf: support pacing offload Willem de Bruijn
2026-09-11 17:13   ` netdev-bot+sashiko
2026-09-12  0:46     ` Willem de Bruijn
2026-09-10 17:10 ` [PATCH net-next v9 5/7] selftests: drv-net: refactor so_txtime errqueue handling Willem de Bruijn
2026-09-10 17:10 ` [PATCH net-next v9 6/7] selftests: drv-net: in so_txtime tell apart sw from hw pacing Willem de Bruijn
2026-09-11 17:13   ` netdev-bot+sashiko
2026-09-12  0:47     ` Willem de Bruijn [this message]
2026-09-10 17:10 ` [PATCH net-next v9 7/7] selftests: drv-net: extend so_txtime with hw offload Willem de Bruijn
2026-09-11 17:13   ` netdev-bot+sashiko
2026-09-12  0:57     ` Willem de Bruijn

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.2e348176f4860@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox