[PATCH net-next v3 1/5] net: export netif_open for self_test usage

mike.marciniszyn@gmail.com posted 5 patches 1 month ago
There is a newer version of this series
[PATCH net-next v3 1/5] net: export netif_open for self_test usage
Posted by mike.marciniszyn@gmail.com 1 month ago
From: "Mike Marciniszyn (Meta)" <mike.marciniszyn@gmail.com>

dev_open() already is exported, but drivers which use the netdev
instance lock need to use netif_open() instead. netif_close() is
also already exported [1] so this completes the pairing.

This export is required for the following fbnic self tests to
avoid calling ndo_stop() and ndo_open() in favor of the
more appropriate netif_open() and netif_close() that notifies
any listeners that the interface went down to test and is now
coming back up.

Link: https://patch.msgid.link/20250309215851.2003708-1-sdf@fomichev.me [1]
Signed-off-by: Mike Marciniszyn (Meta) <mike.marciniszyn@gmail.com>
---
v2 - no changes
v3 - no changes

 net/core/dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 43de5af0d6ec..d1d5694d1ff0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1724,6 +1724,7 @@ int netif_open(struct net_device *dev, struct netlink_ext_ack *extack)
 
 	return ret;
 }
+EXPORT_SYMBOL(netif_open);
 
 static void __dev_close_many(struct list_head *head)
 {
-- 
2.43.0
Re: [PATCH net-next v3 1/5] net: export netif_open for self_test usage
Posted by Mike Marciniszyn 1 month ago
On Thu, Mar 05, 2026 at 10:09:43AM -0500, mike.marciniszyn@gmail.com wrote:
> From: "Mike Marciniszyn (Meta)" <mike.marciniszyn@gmail.com>
>
> dev_open() already is exported, but drivers which use the netdev
> instance lock need to use netif_open() instead. netif_close() is
> also already exported [1] so this completes the pairing.
>
> This export is required for the following fbnic self tests to
> avoid calling ndo_stop() and ndo_open() in favor of the
> more appropriate netif_open() and netif_close() that notifies
> any listeners that the interface went down to test and is now
> coming back up.
>
> Link: https://patch.msgid.link/20250309215851.2003708-1-sdf@fomichev.me [1]
> Signed-off-by: Mike Marciniszyn (Meta) <mike.marciniszyn@gmail.com>
> ---
> v2 - no changes
> v3 - no changes
>
>  net/core/dev.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 43de5af0d6ec..d1d5694d1ff0 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1724,6 +1724,7 @@ int netif_open(struct net_device *dev, struct netlink_ext_ack *extack)
>
>  	return ret;
>  }
> +EXPORT_SYMBOL(netif_open);
>

There is an issue with the v7 code base.

In that code base, the dev_open() behaves like the old netif_open().

Mike