public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Joe Damato <joe@dama.to>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org,  "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>,
	 andrew+netdev@lunn.ch,  linux-kernel@vger.kernel.org,
	 willemb@google.com,  linux-kselftest@vger.kernel.org
Subject: Re: [net-next v2 2/3] selftests/net: Test PACKET_STATISTICS drops
Date: Mon, 06 Apr 2026 17:20:30 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.3156bd9082476@gmail.com> (raw)
In-Reply-To: <adPfTwbARPVFLys8@devvm20253.cco0.facebook.com>

Joe Damato wrote:
> On Sat, Apr 04, 2026 at 11:08:15AM -0400, Willem de Bruijn wrote:
> > Joe Damato wrote:
> 
> [...]
> 
> > > @@ -396,6 +424,11 @@ static void run_test(void)
> > >  
> > >  	total_len = do_tx();
> > >  
> > > +	if (cfg_drop) {
> > > +		check_packet_stats(fds);
> > > +		goto out;
> > > +	}
> > 
> > Sashiko pointed out
> 
> In the future, please link to the AI report.
> 
> > that there may be a race here between rx
> > processing in the softirq and check_packet_stats. Seems plausible.
> 
> Can you elaborate why this is true?
> 
> I could be wrong, but I scanned the code and __local_bh_enable_ip seems to run
> softirq synchronously in this case, so I think the code is correct.

You mean that after the return to user in sendmsg, the packets are
guaranteed to have been queued to the sd->input_pkt_queue, the napi
schedule was run by enqueue_to_backlog and napi was run on this
cpu as a result of reenabling BH. At the end of dev_queue_xmit? I
recall that there may be a common one on syscall return too, but the
details elude me right now.

Either way, makes sense. I had not fully appreciated that the 
softirq schedule is this deterministic.

  parent reply	other threads:[~2026-04-06 21:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 23:32 [net-next 0/3] Extend packet socket selftests Joe Damato
2026-04-03 23:32 ` [net-next v2 1/3] selftests/net: Test PACKET_STATISTICS Joe Damato
2026-04-03 23:32 ` [net-next v2 2/3] selftests/net: Test PACKET_STATISTICS drops Joe Damato
2026-04-04 15:08   ` Willem de Bruijn
2026-04-06 16:29     ` Joe Damato
2026-04-06 18:37       ` Jakub Kicinski
2026-04-06 21:20       ` Willem de Bruijn [this message]
2026-04-03 23:32 ` [net-next v2 3/3] selftests/net: Test PACKET_AUXDATA Joe Damato
2026-04-04 15:10   ` Willem de Bruijn
2026-04-06 16:36     ` Joe Damato
2026-04-05  3:04   ` Willem de Bruijn
2026-04-05  3:30     ` Willem de Bruijn
2026-04-06 17:01       ` Joe Damato
2026-04-06 20:56         ` 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.3156bd9082476@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=joe@dama.to \
    --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 \
    --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