summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2024-03-01 12:09:40 +0100
committerDavid S. Miller <davem@davemloft.net>2024-03-01 12:09:40 +0100
commite960825709330cb199d209740326cec37e8c419d (patch)
treef2e7cea036c72ec80082a44b44f0d412444c74ba /net/core
parentMerge branch 'netdevsim-link' (diff)
parentinet: use xa_array iterator to implement inet_dump_ifaddr() (diff)
downloadlinux-e960825709330cb199d209740326cec37e8c419d.tar.xz
linux-e960825709330cb199d209740326cec37e8c419d.zip
Merge branch 'inet_dump_ifaddr-no-rtnl'
Eric Dumazet says: ==================== inet: no longer use RTNL to protect inet_dump_ifaddr() This series convert inet so that a dump of addresses (ip -4 addr) no longer requires RTNL. ==================== Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 4868e6734509..fe054cbd41e9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -180,8 +180,9 @@ static DECLARE_RWSEM(devnet_rename_sem);
static inline void dev_base_seq_inc(struct net *net)
{
- while (++net->dev_base_seq == 0)
- ;
+ unsigned int val = net->dev_base_seq + 1;
+
+ WRITE_ONCE(net->dev_base_seq, val ?: 1);
}
static inline struct hlist_head *dev_name_hash(struct net *net, const char *name)