mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Mina Almasry <almasrymina@google.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Weiming Shi <bestswngs@gmail.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	David Wei <dw@davidwei.uk>,
	Stanislav Fomichev <sdf.kernel@gmail.com>,
	Bobby Eshleman <bobbyeshleman@meta.com>,
	Dragos Tatulea <dtatulea@nvidia.com>
Subject: Re: [PATCH net-next v3 4/6] net: devmem: always populate bind_dev and detach both devices on unregister
Date: Tue, 17 Nov 2026 15:40:10 +0100	[thread overview]
Message-ID: <10582a05-322c-4fe7-b1aa-b3d8a61fa07d@redhat.com> (raw)
In-Reply-To: <20261115022607.348112-5-almasrymina@google.com>

On 11/15/26 03:26, Mina Almasry wrote:
> @@ -252,21 +254,18 @@ void net_devmem_dev_unregister(struct net_device *dev)
>   
>   	xa_lock(&net_devmem_dmabuf_bindings);
>   	xa_for_each(&net_devmem_dmabuf_bindings, xa_idx, binding) {
> -		if (binding->direction == DMA_FROM_DEVICE) {
> -			if (READ_ONCE(binding->map_dev) != dev ||
> -			    xa_get_mark(&net_devmem_dmabuf_bindings, xa_idx,
> -					NET_DEVMEM_BINDING_LIVE))
> -				continue;
> -		} else {
> -			if (READ_ONCE(binding->bind_dev) == dev)
> -				WRITE_ONCE(binding->bind_dev, NULL);
> -			if (READ_ONCE(binding->map_dev) != dev)
> -				continue;
> -			WRITE_ONCE(binding->bind_dev, NULL);
> +		if (READ_ONCE(binding->bind_dev) == dev) {
>   			__xa_clear_mark(&net_devmem_dmabuf_bindings, xa_idx,
>   					NET_DEVMEM_BINDING_LIVE);
> +			if (xa_empty(&binding->bound_rxqs) ||
> +			    !netif_is_queue_leasee(dev))
> +				WRITE_ONCE(binding->bind_dev, NULL);
>   		}
> +		if (READ_ONCE(binding->map_dev) != dev)
> +			continue;
>   
> +		__xa_clear_mark(&net_devmem_dmabuf_bindings, xa_idx,
> +				NET_DEVMEM_BINDING_LIVE);
>   		xa_unlock(&net_devmem_dmabuf_bindings);

Clashiko note here a synchronize_rcu()/synchronize_net() may be needed:

https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261115022607.348112-1-almasrymina@google.com

even if the lack of it is not catastrophic. Sounded quite
convincing to me.

/P



  reply	other threads:[~2026-11-17 14:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15  2:26 [PATCH net-next v3 0/6] net: devmem: support leased RX and TX queues on netdev unregister Mina Almasry
2026-11-15  2:26 ` [PATCH net-next v3 1/6] net: devmem: pass net_device pointer to net_devmem_lock_dev() Mina Almasry
2026-11-15  2:26 ` [PATCH net-next v3 2/6] net: devmem: rename binding dev and vdev to map_dev and bind_dev Mina Almasry
2026-11-15  2:26 ` [PATCH net-next v3 3/6] net: guard memory provider RX queue open and close on unregister Mina Almasry
2026-11-15  2:26 ` [PATCH net-next v3 4/6] net: devmem: always populate bind_dev and detach both devices " Mina Almasry
2026-11-17 14:40   ` Paolo Abeni [this message]
2026-11-15  2:26 ` [PATCH net-next v3 5/6] net: devmem: resolve physical map_dev for leased RX bindings Mina Almasry
2026-11-15  2:26 ` [PATCH net-next v3 6/6] selftests: net: add leased devmem RX and TX netdev unregister tests Mina Almasry
2026-11-15 20:08 ` [PATCH net-next v3 0/6] net: devmem: support leased RX and TX queues on netdev unregister netdev-bot+sinfo
2026-11-16 20:49   ` Mina Almasry

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=10582a05-322c-4fe7-b1aa-b3d8a61fa07d@redhat.com \
    --to=pabeni@redhat.com \
    --cc=almasrymina@google.com \
    --cc=bestswngs@gmail.com \
    --cc=bobbyeshleman@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=dw@davidwei.uk \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    --cc=sdf.kernel@gmail.com \
    --cc=shuah@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

all inboxes | Powered by JetHome®