public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel•org>
To: Kuniyuki Iwashima <kuniyu@amazon•com>
Cc: Andrew Lunn <andrew+netdev@lunn•ch>,
	"David S. Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	Paolo Abeni <pabeni@redhat•com>, Simon Horman <horms@kernel•org>,
	Kuniyuki Iwashima <kuni1840@gmail•com>, <netdev@vger•kernel.org>
Subject: Re: [PATCH v2 net-next 2/3] pfcp: Convert pfcp_net_exit() to ->exit_rtnl().
Date: Wed, 23 Apr 2025 06:40:26 -0700	[thread overview]
Message-ID: <20250423064026.636c822f@kernel.org> (raw)
In-Reply-To: <20250418003259.48017-3-kuniyu@amazon.com>

On Thu, 17 Apr 2025 17:32:33 -0700 Kuniyuki Iwashima wrote:
> -static void __net_exit pfcp_net_exit(struct net *net)
> +static void __net_exit pfcp_net_exit_rtnl(struct net *net,
> +					  struct list_head *dev_to_kill)
>  {
>  	struct pfcp_net *pn = net_generic(net, pfcp_net_id);
>  	struct pfcp_dev *pfcp, *pfcp_next;
> -	struct net_device *dev;
> -	LIST_HEAD(list);
> -
> -	rtnl_lock();
> -	for_each_netdev(net, dev)
> -		if (dev->rtnl_link_ops == &pfcp_link_ops)
> -			pfcp_dellink(dev, &list);
>  
>  	list_for_each_entry_safe(pfcp, pfcp_next, &pn->pfcp_dev_list, list)
> -		pfcp_dellink(pfcp->dev, &list);
> -
> -	unregister_netdevice_many(&list);
> -	rtnl_unlock();
> +		pfcp_dellink(pfcp->dev, dev_to_kill);

Kuniyuki, I got distracted by the fact the driver is broken but I think
this isn't right. The devices do not migrate to the local pcfp_dev_list
when their netns is changed. They always stay on the list of original
netns. Which I guess may make some sense as that's where their socket
is? So we need to scan both the pcfp_dev_list _and_ the local netdevs
that are pfcp. Am I misunderstanding something?

For gtp was the problem perhaps that we were walking multiple
netns'es? I'm my understanding is correct then 4ccacf86491 needs 
a redo :(

  parent reply	other threads:[~2025-04-23 13:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18  0:32 [PATCH v2 net-next 0/3] net: Followup series for ->exit_rtnl() Kuniyuki Iwashima
2025-04-18  0:32 ` [PATCH v2 net-next 1/3] net: Drop hold_rtnl arg from ops_undo_list() Kuniyuki Iwashima
2025-04-18  0:32 ` [PATCH v2 net-next 2/3] pfcp: Convert pfcp_net_exit() to ->exit_rtnl() Kuniyuki Iwashima
2025-04-23  2:47   ` Jakub Kicinski
2025-04-23  8:37     ` Michal Swiatkowski
2025-04-23 13:33       ` Jakub Kicinski
2025-04-24  4:40         ` Michal Swiatkowski
2025-04-24 22:26           ` Jakub Kicinski
2025-04-25  4:28             ` Michal Swiatkowski
2025-04-23 13:40   ` Jakub Kicinski [this message]
2025-04-23 14:12     ` Kuniyuki Iwashima
2025-04-23 22:33       ` Jakub Kicinski
2025-04-23 22:52       ` Jakub Kicinski
2025-04-24  2:23         ` Kuniyuki Iwashima
2025-04-24 22:24           ` Jakub Kicinski
2025-04-18  0:32 ` [PATCH v2 net-next 3/3] ppp: Split ppp_exit_net() " Kuniyuki Iwashima
2025-04-23  2:50 ` [PATCH v2 net-next 0/3] net: Followup series for ->exit_rtnl() patchwork-bot+netdevbpf

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=20250423064026.636c822f@kernel.org \
    --to=kuba@kernel$(echo .)org \
    --cc=andrew+netdev@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=kuni1840@gmail$(echo .)com \
    --cc=kuniyu@amazon$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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