]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: convert dev->rtnl_link_state to a bool
authorJakub Kicinski <kuba@kernel.org>
Thu, 10 Apr 2025 01:42:46 +0000 (18:42 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 14 Apr 2025 21:29:54 +0000 (14:29 -0700)
commit097f171f98289cf737437599c40b0d1e81266e9e
tree4f3079aa81f9ec85cfa42b8b0b4bf694446d180a
parentc26c192c3d486a2a7d83d254bae294c2f8f50abf
net: convert dev->rtnl_link_state to a bool

netdevice reg_state was split into two 16 bit enums back in 2010
in commit a2835763e130 ("rtnetlink: handle rtnl_link netlink
notifications manually"). Since the split the fields have been
moved apart, and last year we converted reg_state to a normal
u8 in commit 4d42b37def70 ("net: convert dev->reg_state to u8").

rtnl_link_state being a 16 bitfield makes no sense. Convert it
to a single bool, it seems very unlikely after 15 years that
we'll need more values in it.

We could drop dev->rtnl_link_ops from the conditions but feels
like having it there more clearly points at the reason for this
hack.

Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250410014246.780885-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/net_cachelines/net_device.rst
include/linux/netdevice.h
net/core/dev.c
net/core/rtnetlink.c