diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2024-12-10 17:12:41 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-12-12 13:59:18 +0300 |
commit | d2516c3a53705f783bb6868df0f4a2b977898a71 (patch) | |
tree | 4f73712a88b678ec5d2ed8a148257fe63451576a /include/linux/netdev_features.h | |
parent | f8d4bc455047cf3903cd6f85f49978987dbb3027 (diff) | |
download | linux-d2516c3a53705f783bb6868df0f4a2b977898a71.tar.xz |
net, team, bonding: Add netdev_base_features helper
Both bonding and team driver have logic to derive the base feature
flags before iterating over their slave devices to refine the set
via netdev_increment_features().
Add a small helper netdev_base_features() so this can be reused
instead of having it open-coded multiple times.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Ido Schimmel <idosch@idosch.org>
Cc: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20241210141245.327886-1-daniel@iogearbox.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux/netdev_features.h')
-rw-r--r-- | include/linux/netdev_features.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 66e7d26b70a4..11be70a7929f 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -253,4 +253,11 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) NETIF_F_GSO_UDP_TUNNEL | \ NETIF_F_GSO_UDP_TUNNEL_CSUM) +static inline netdev_features_t netdev_base_features(netdev_features_t features) +{ + features &= ~NETIF_F_ONE_FOR_ALL; + features |= NETIF_F_ALL_FOR_ALL; + return features; +} + #endif /* _LINUX_NETDEV_FEATURES_H */ |