[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240208141154.1131622-12-edumazet@google.com>
Date: Thu, 8 Feb 2024 14:11:52 +0000
From: Eric Dumazet <edumazet@...gle.com>
To: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH v2 net-next 11/13] net: remove dev_base_lock from do_setlink()
We hold RTNL here, and dev->link_mode readers already
are using READ_ONCE().
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
net/core/rtnetlink.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 46710e5f9bd19298403cdb8c179f33f155a4c9ad..66f1fd4e61e3042da3403e512d051267dc5fd03c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2979,11 +2979,9 @@ static int do_setlink(const struct sk_buff *skb,
if (tb[IFLA_LINKMODE]) {
unsigned char value = nla_get_u8(tb[IFLA_LINKMODE]);
- write_lock(&dev_base_lock);
if (dev->link_mode ^ value)
status |= DO_SETLINK_NOTIFY;
WRITE_ONCE(dev->link_mode, value);
- write_unlock(&dev_base_lock);
}
if (tb[IFLA_VFINFO_LIST]) {
--
2.43.0.594.gd9cf4e227d-goog
Powered by blists - more mailing lists