From patchwork Fri Feb 14 08:18:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13974602 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-52004.amazon.com (smtp-fw-52004.amazon.com [52.119.213.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B3B1222564 for ; Fri, 14 Feb 2025 08:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739521162; cv=none; b=BlztamevIa4vqiwcQQTn7G+zQytjvwG4JyW4ingVAXaSyb/ulxlihiZOLbVcArA7vlzYcZj9nlIZ/G/xMj57+SvA2wbmmQN2Yl+mrFLzQSUbe2C0N23VKA74SVGcvDtPWLby3HhPmQkFVXtWQ+wXTMQZHjm5rmZCQ6CrQR9d8KQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739521162; c=relaxed/simple; bh=VLBJuY7oCgJw0LKo9mxBuWijtAEJXjN0DxwoareQl5M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=F0Ib7/Sldw9vkcIjmJ0IYqCxep+mNg+gtElQovg6lEr7csk6trJ7oGMLHk+Mi0MOTcOf0odbFD/VirmGFIyOxXC1GlBWvngY79tr9rtGBZmc5QjDqre0uG5jwkawjws84YQrrDy7p4GfT5xiTkrye3mYNXiby1ddgnxoOB/Y2uY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=lSKzBAOt; arc=none smtp.client-ip=52.119.213.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="lSKzBAOt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1739521161; x=1771057161; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3Leu2dT5qI9tz/h9yI2wGAVB7w/codXrefp3fDbh1eM=; b=lSKzBAOt3T/KkZrLQVJYU38zkRUhe7lRZMOeBzS1jZbfVW1wjrl8z+rs cczE+3hogY6qJCEg6I9hkFliqz1SpRvOX6/DyNMuAkD8DjNCN7X1SoIwy Sgq7Xi/3KYGHO6/kvXrRcF8fN6K/qMAQqCIcZBTJykqZJ4RAlAbn1qGOZ g=; X-IronPort-AV: E=Sophos;i="6.13,285,1732579200"; d="scan'208";a="271123782" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.43.8.2]) by smtp-border-fw-52004.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2025 08:19:05 +0000 Received: from EX19MTAUWC002.ant.amazon.com [10.0.7.35:1169] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.10.141:2525] with esmtp (Farcaster) id 23e23bed-b56b-4753-89eb-6f43ed1d6ea6; Fri, 14 Feb 2025 08:19:03 +0000 (UTC) X-Farcaster-Flow-ID: 23e23bed-b56b-4753-89eb-6f43ed1d6ea6 Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.39; Fri, 14 Feb 2025 08:19:00 +0000 Received: from 6c7e67bfbae3.amazon.com (10.118.254.117) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Fri, 14 Feb 2025 08:18:56 +0000 From: Kuniyuki Iwashima To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman CC: Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net-next 1/3] pfcp: Convert pfcp_net_exit() to ->exit_batch_rtnl(). Date: Fri, 14 Feb 2025 17:18:16 +0900 Message-ID: <20250214081818.81658-2-kuniyu@amazon.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250214081818.81658-1-kuniyu@amazon.com> References: <20250214081818.81658-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D046UWB001.ant.amazon.com (10.13.139.187) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org pfcp_net_exit() holds RTNL and calls unregister_netdevice_queue() for dev in the netns. Let's convert pfcp_net_exit() to ->exit_batch_rtnl to save RTNL dances for each netns. Signed-off-by: Kuniyuki Iwashima --- drivers/net/pfcp.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/net/pfcp.c b/drivers/net/pfcp.c index 68d0d9e92a22..5cb8635ada20 100644 --- a/drivers/net/pfcp.c +++ b/drivers/net/pfcp.c @@ -244,30 +244,35 @@ static int __net_init pfcp_net_init(struct net *net) return 0; } -static void __net_exit pfcp_net_exit(struct net *net) +static void __net_exit pfcp_destroy_links(struct net *net, + struct list_head *dev_kill_list) { 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); + pfcp_dellink(dev, dev_kill_list); list_for_each_entry_safe(pfcp, pfcp_next, &pn->pfcp_dev_list, list) - pfcp_dellink(pfcp->dev, &list); + pfcp_dellink(pfcp->dev, dev_kill_list); +} + +static void __net_exit pfcp_net_exit_batch_rtnl(struct list_head *net_exit_list, + struct list_head *dev_kill_list) +{ + struct net *net; - unregister_netdevice_many(&list); - rtnl_unlock(); + list_for_each_entry(net, net_exit_list, exit_list) + pfcp_destroy_links(net, dev_kill_list); } static struct pernet_operations pfcp_net_ops = { - .init = pfcp_net_init, - .exit = pfcp_net_exit, - .id = &pfcp_net_id, - .size = sizeof(struct pfcp_net), + .init = pfcp_net_init, + .exit_batch_rtnl = pfcp_net_exit_batch_rtnl, + .id = &pfcp_net_id, + .size = sizeof(struct pfcp_net), }; static int __init pfcp_init(void) From patchwork Fri Feb 14 08:18:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13974603 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-52005.amazon.com (smtp-fw-52005.amazon.com [52.119.213.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87E70221D8B for ; Fri, 14 Feb 2025 08:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739521172; cv=none; b=Ik0/2hBINRJSq0xVf38HFO8BxQKf6VAAZV6ZiPraOIEFWSqGI5hNwf0We1KgOnC3EihiEyu1LsFjR2cH22JYibH5ZhfryDTgCxQxZ4AjWYc5AtrB+iYh5CxeoknD3T/LyG4XbD9QjohdThBD8b9uNCHWGAb1xfNVqiRxj++Yph8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739521172; c=relaxed/simple; bh=0DF0tiBuRLg1cqw2/GAeKCP6a9i9+E5SheSUZ5PEjZc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OmyTJLgUr7X7nruQJcRfl4kO6tWr0YJUmu+U3NzxmmL2f+4S/X5knidzRVVrZXjjZAShUqjUIUhT1Ap5CJ+Y7JepKo7gOYdFGnk9KFbT2rOWyYUjaSJudaLlm0X3AMFL2700GoGZmPWMhubsA1M+vCoRUvEMVQULcAYFgkvtt0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=fMbvZUP4; arc=none smtp.client-ip=52.119.213.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="fMbvZUP4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1739521171; x=1771057171; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OcIfFwdjbRLcEEr6/YWi/r3QPaIXQWMNeM5vm/mrTrQ=; b=fMbvZUP4gJXJtu8Us1OF0/+ND4DXoKcEP0/dpAeXh1dJe69YmT8D/7lR fOGDn+fFmotSFKato0syb1lf4Jn9YtqjwMEpvG5iOAC91RSMy8iH2Y1g3 yXMiubMsLAwOoPoVKstTArxyz0F/hVq8p5Of8hKUpDHV3DeYc2SdnC6pA s=; X-IronPort-AV: E=Sophos;i="6.13,285,1732579200"; d="scan'208";a="718726583" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-52005.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2025 08:19:29 +0000 Received: from EX19MTAUWA002.ant.amazon.com [10.0.21.151:29327] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.41.245:2525] with esmtp (Farcaster) id e693f473-31d9-40ee-a022-1f5ee1a2a83c; Fri, 14 Feb 2025 08:19:28 +0000 (UTC) X-Farcaster-Flow-ID: e693f473-31d9-40ee-a022-1f5ee1a2a83c Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.39; Fri, 14 Feb 2025 08:19:27 +0000 Received: from 6c7e67bfbae3.amazon.com (10.118.254.117) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Fri, 14 Feb 2025 08:19:24 +0000 From: Kuniyuki Iwashima To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman CC: Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net-next 2/3] ppp: Split ppp_exit_net() to ->exit_batch_rtnl(). Date: Fri, 14 Feb 2025 17:18:17 +0900 Message-ID: <20250214081818.81658-3-kuniyu@amazon.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250214081818.81658-1-kuniyu@amazon.com> References: <20250214081818.81658-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D033UWA004.ant.amazon.com (10.13.139.85) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org ppp_exit_net() unregisters devices related to the netns under RTNL and destroys lists and IDR. Let's move the device unregistration to ->exit_batch_rtnl() to save RTNL dances for each netns. While at it, unregister_netdevice_queue() is replaced with ppp_nl_dellink() to avoid a potential issue like the one recently found in geneve. [0] Note that ppp_nl_dellink() is bare unregister_netdevice_queue(). Link: https://lore.kernel.org/netdev/20250213043354.91368-1-kuniyu@amazon.com/ [0] Signed-off-by: Kuniyuki Iwashima --- drivers/net/ppp/ppp_generic.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 4583e15ad03a..560fcc495cd8 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -1134,28 +1134,38 @@ static __net_init int ppp_init_net(struct net *net) return 0; } -static __net_exit void ppp_exit_net(struct net *net) +static void ppp_nl_dellink(struct net_device *dev, struct list_head *head); + +static __net_exit void ppp_destroy_links(struct net *net, + struct list_head *dev_kill_list) { struct ppp_net *pn = net_generic(net, ppp_net_id); - struct net_device *dev; - struct net_device *aux; + struct net_device *dev, *aux; struct ppp *ppp; - LIST_HEAD(list); int id; - rtnl_lock(); - for_each_netdev_safe(net, dev, aux) { + for_each_netdev_safe(net, dev, aux) if (dev->netdev_ops == &ppp_netdev_ops) - unregister_netdevice_queue(dev, &list); - } + ppp_nl_dellink(dev, dev_kill_list); idr_for_each_entry(&pn->units_idr, ppp, id) /* Skip devices already unregistered by previous loop */ if (!net_eq(dev_net(ppp->dev), net)) - unregister_netdevice_queue(ppp->dev, &list); + ppp_nl_dellink(ppp->dev, dev_kill_list); +} - unregister_netdevice_many(&list); - rtnl_unlock(); +static __net_exit void ppp_exit_net_batch_rtnl(struct list_head *net_exit_list, + struct list_head *dev_kill_list) +{ + struct net *net; + + list_for_each_entry(net, net_exit_list, exit_list) + ppp_destroy_links(net, dev_kill_list); +} + +static __net_exit void ppp_exit_net(struct net *net) +{ + struct ppp_net *pn = net_generic(net, ppp_net_id); mutex_destroy(&pn->all_ppp_mutex); idr_destroy(&pn->units_idr); @@ -1165,6 +1175,7 @@ static __net_exit void ppp_exit_net(struct net *net) static struct pernet_operations ppp_net_ops = { .init = ppp_init_net, + .exit_batch_rtnl = ppp_exit_net_batch_rtnl, .exit = ppp_exit_net, .id = &ppp_net_id, .size = sizeof(struct ppp_net), From patchwork Fri Feb 14 08:18:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13974604 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-52002.amazon.com (smtp-fw-52002.amazon.com [52.119.213.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F4A321D596 for ; Fri, 14 Feb 2025 08:20:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739521209; cv=none; b=PheDzjp3ese1CN01NUhBs/o0SlBU47gDMNjvfFtoziIBvD3Z56IbJFFK1PsHerNenarEW4J1werABtM+wlePjXIG+KvJGQRPCh4wSSa/phHqeFyp25QbhXFCk26tS6JDVaJV9+tLG3BSHamdJVsjGTvrLhMQfP4ZnHWeUQjDrL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739521209; c=relaxed/simple; bh=9bFCaE8eScKI2/xsZ5wdjcHaDxdtJl8IXFst8prmZqw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZUktGiNznPzhMr7V2ZgBYl711BjeoB4ObEaQb8U+vm0GoJKlGzfpJYJfdRe4dnZ3umjJsHucEQQlsS5dSskDa7gwpi1qgvyD10pytvdLJVwTXU8xTOnOhueKSspZZjKPR8NTmgyJnezaQW0ezhvZGJ7p0+mX5g9j4NbF/CthEoM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=v9XIPkLY; arc=none smtp.client-ip=52.119.213.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="v9XIPkLY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1739521207; x=1771057207; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YyCfsp8prorlfSI+QgOrST+6tDqiuOlyGQla/LQw/RI=; b=v9XIPkLYMcZGwJSkBnExFkS3eNMSkn9PiWTWRmjFEL4tfGZzRaABGC7t NRh06a5VwiylSJVS7pcJApRVs0K5laZ/E/YO1zyRc1miVnqL7ZdcoZnzb ELSOv1NOaJ4T/C6UD9eWC6VX8UMA/DCumtyodxU7toRvbNnwHG4aOq8fS o=; X-IronPort-AV: E=Sophos;i="6.13,285,1732579200"; d="scan'208";a="697061564" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-52002.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2025 08:19:57 +0000 Received: from EX19MTAUWB001.ant.amazon.com [10.0.7.35:63692] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.55.73:2525] with esmtp (Farcaster) id 6cfd46ff-bf64-42d4-bd4b-5eae50c7395d; Fri, 14 Feb 2025 08:19:54 +0000 (UTC) X-Farcaster-Flow-ID: 6cfd46ff-bf64-42d4-bd4b-5eae50c7395d Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWB001.ant.amazon.com (10.250.64.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.39; Fri, 14 Feb 2025 08:19:54 +0000 Received: from 6c7e67bfbae3.amazon.com (10.118.254.117) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Fri, 14 Feb 2025 08:19:50 +0000 From: Kuniyuki Iwashima To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman CC: Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net-next 3/3] bareudp: Call bareudp_dellink() in bareudp_destroy_tunnels(). Date: Fri, 14 Feb 2025 17:18:18 +0900 Message-ID: <20250214081818.81658-4-kuniyu@amazon.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250214081818.81658-1-kuniyu@amazon.com> References: <20250214081818.81658-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D041UWA003.ant.amazon.com (10.13.139.105) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org bareudp devices are destroyed in two places during netns dismantle: bareudp_exit_batch_rtnl() and default_device_exit_batch(). bareudp_exit_batch_rtnl() unregisters devices whose backend UDP socket is in the dying netns. default_device_exit_batch() unregisters devices in the dying netns. The latter calls ->dellink(), but the former calls unregister_netdevice_queue() only. In the former case, the device remains in net_generic(net, bareudp_net_id)->bareudp_list. There is no real bug, but let's call ->dellink() to avoid a potential issue like the one recently found in geneve. [0] Link: https://lore.kernel.org/netdev/20250213043354.91368-1-kuniyu@amazon.com/ [0] Signed-off-by: Kuniyuki Iwashima --- drivers/net/bareudp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c index 70814303aab8..396a8b28cf0c 100644 --- a/drivers/net/bareudp.c +++ b/drivers/net/bareudp.c @@ -780,7 +780,7 @@ static void bareudp_destroy_tunnels(struct net *net, struct list_head *head) struct bareudp_dev *bareudp, *next; list_for_each_entry_safe(bareudp, next, &bn->bareudp_list, next) - unregister_netdevice_queue(bareudp->dev, head); + bareudp_dellink(bareudp->dev, head); } static void __net_exit bareudp_exit_batch_rtnl(struct list_head *net_list,