]> git.dujemihanovic.xyz Git - linux.git/commit
netdevice: convert private flags > BIT(31) to bitfields
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Thu, 29 Aug 2024 12:33:36 +0000 (14:33 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Sep 2024 09:36:43 +0000 (11:36 +0200)
commitbeb5a9bea8239cdf4adf6b62672e30db3e9fa5ce
tree0b926da32eb766c8fa65ba909606be8011cf59c9
parent075e3d30e4a3da8eadd12f2f063dc8e2ea9e1f08
netdevice: convert private flags > BIT(31) to bitfields

Make dev->priv_flags `u32` back and define bits higher than 31 as
bitfield booleans as per Jakub's suggestion. This simplifies code
which accesses these bits with no optimization loss (testb both
before/after), allows to not extend &netdev_priv_flags each time,
but also scales better as bits > 63 in the future would only add
a new u64 to the structure with no complications, comparing to
that extending ::priv_flags would require converting it to a bitmap.
Note that I picked `unsigned long :1` to not lose any potential
optimizations comparing to `bool :1` etc.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Documentation/networking/net_cachelines/net_device.rst
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
drivers/net/macvlan.c
drivers/net/vxlan/vxlan_core.c
include/linux/netdevice.h
net/8021q/vlanproc.c
net/core/dev.c
net/core/dev_ioctl.c
net/core/rtnetlink.c