diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2026-10-01 20:47:15 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-06 15:56:16 -0700 |
| commit | 2e65372a2b64a1d6d1e27dff0579b3a609b2e405 (patch) | |
| tree | 9749abdfbfa7a9d7c47a452a3ca7a064db600df3 /include | |
| parent | 3d51928a882b768581e79c0ef04b63e196d5ef4c (diff) | |
| download | linux-next-2e65372a2b64a1d6d1e27dff0579b3a609b2e405.tar.gz linux-next-2e65372a2b64a1d6d1e27dff0579b3a609b2e405.zip | |
net: Rename dev_isalive() to netif_is_alive().
The next patch needs to use dev_isalive() in xfrm.
We should try to avoid using the dev_ prefix on APIs
we export via include/linux/.
Let's move it to include/linux/netdevice.h and rename
to netif_is_alive().
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Chris J Arges <carges@cloudflare.com>
Link: https://patch.msgid.link/20261001204752.2572265-4-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netdevice.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f61c97231309..8cae9b00211e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5715,6 +5715,12 @@ static inline const char *netdev_name(const struct net_device *dev) return dev->name; } +/* Caller holds RTNL, netdev->lock or RCU */ +static inline bool netif_is_alive(const struct net_device *dev) +{ + return READ_ONCE(dev->reg_state) <= NETREG_REGISTERED; +} + static inline const char *netdev_reg_state(const struct net_device *dev) { u8 reg_state = READ_ONCE(dev->reg_state); |
