mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Koichiro Den <den@valinux.co.jp>
Cc: Simon Horman <horms@kernel.org>, Jon Mason <jdmason@kudzu.us>,
	Dave Jiang <dave.jiang@intel.com>,
	Allen Hubbe <allenbh@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, ntb@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] net: ntb_netdev: Fix statistics races
Date: Fri, 28 Aug 2026 13:49:57 -0700	[thread overview]
Message-ID: <20260828134957.5b95472b@kernel.org> (raw)
In-Reply-To: <20260828154122.2643578-1-den@valinux.co.jp>

On Sat, 29 Aug 2026 00:41:22 +0900 Koichiro Den wrote:
> Note that transport callbacks may still complete after
> unregister_netdev(), so tie the tstats lifetime to the client device.

We shouldn't really call devm_netdev_alloc_pcpu_stats() for types
of stats declared by netdev core. We should set the pointer type
like you did in v1.

Could you instead fix the fact that the Tx callback runs on 
an unregistered device? Maybe just wrap the whole body of
ntb_netdev_tx_handler() in RCU and check 

	READ_ONCE(ndev->reg_state) == NETREG_REGISTERED

?

  parent reply	other threads:[~2026-08-28 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 15:41 Koichiro Den
2026-08-28 15:51 ` Eric Dumazet
2026-08-28 20:49 ` Jakub Kicinski [this message]
2026-08-28 21:10   ` Jakub Kicinski
2026-08-29 14:38     ` Koichiro Den

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=20260828134957.5b95472b@kernel.org \
    --to=kuba@kernel.org \
    --cc=allenbh@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=dave.jiang@intel.com \
    --cc=davem@davemloft.net \
    --cc=den@valinux.co.jp \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdmason@kudzu.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ntb@lists.linux.dev \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®