public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: Frederic Weisbecker <frederic@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Waiman Long <longman@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Hayes Wang <hayeswang@realtek.com>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] net: Assert proper context while calling napi_schedule()
Date: Thu, 13 Feb 2025 07:14:26 -0800	[thread overview]
Message-ID: <20250213071426.01490615@kernel.org> (raw)
In-Reply-To: <20250213-translucent-nightingale-of-upgrade-b41f2e@leitao>

On Thu, 13 Feb 2025 01:58:17 -0800 Breno Leitao wrote:
> > Looks like netcons is hitting this warning in netdevsim:
> > 
> > [   16.063196][  T219]  nsim_start_xmit+0x4e0/0x6f0 [netdevsim]
> > [   16.063219][  T219]  ? netif_skb_features+0x23e/0xa80
> > [   16.063237][  T219]  netpoll_start_xmit+0x3c3/0x670
> > [   16.063258][  T219]  __netpoll_send_skb+0x3e9/0x800
> > [   16.063287][  T219]  netpoll_send_skb+0x2a/0xa0
> > [   16.063298][  T219]  send_ext_msg_udp+0x286/0x350 [netconsole]
> > [   16.063325][  T219]  write_ext_msg+0x1c6/0x230 [netconsole]
> > [   16.063346][  T219]  console_emit_next_record+0x20d/0x430
> > 
> > https://netdev-3.bots.linux.dev/vmksft-net-drv-dbg/results/990261/7-netcons-basic-sh/stderr
> > 
> > We gotta fix that first.  
> 
> Thanks Jakub,
> 
> I understand that it will be fixed by this patchset, right?

The problem is a bit nasty, on a closer look. We don't know if netcons
is called in IRQ context or not. How about we add an hrtimer to netdevsim,
schedule it to fire 5usec in the future instead of scheduling NAPI
immediately? We can call napi_schedule() from a timer safely.

Unless there's another driver which schedules NAPI from xmit.
Then we'd need to try harder to fix this in netpoll.
veth does use NAPI on xmit but it sets IFF_DISABLE_NETPOLL already.

  reply	other threads:[~2025-02-13 15:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 17:43 [PATCH 0/2] net: Fix/prevent napi_schedule() call from bare task context Frederic Weisbecker
2025-02-12 17:43 ` [PATCH 1/2] net: Assert proper context while calling napi_schedule() Frederic Weisbecker
2025-02-13  3:48   ` Jakub Kicinski
2025-02-13  9:58     ` Breno Leitao
2025-02-13 15:14       ` Jakub Kicinski [this message]
2025-02-13 18:14         ` Breno Leitao
2025-02-13 19:04           ` Jakub Kicinski
2025-02-13 20:38             ` Frederic Weisbecker
2025-02-14 22:00               ` Jakub Kicinski
2025-02-15 21:16                 ` Frederic Weisbecker
2025-02-14 13:05             ` Breno Leitao
2025-02-14 16:43         ` Breno Leitao
2025-02-14 22:10           ` Jakub Kicinski
2025-02-17 16:46             ` Breno Leitao
2025-02-17 17:37               ` Jakub Kicinski
2025-02-13 20:39     ` Frederic Weisbecker
2025-02-14 22:03       ` Jakub Kicinski
2025-02-12 17:43 ` [PATCH 2/2] r8152: Call napi_schedule() from proper context Frederic Weisbecker
2025-02-12 20:49   ` Francois Romieu
2025-02-12 20:58     ` Frederic Weisbecker
2025-02-18 20:12       ` Paul Menzel
2025-04-27 20:50         ` Tobias Jakobi
2025-04-28 17:49           ` Jakub Kicinski
2025-04-28 20:26             ` Tobias Jakobi

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=20250213071426.01490615@kernel.org \
    --to=kuba@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frederic@kernel.org \
    --cc=hayeswang@realtek.com \
    --cc=horms@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /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