net, team, bonding: Add netdev_base_features helper
Subsystems (5)
Daniel Borkmann
maintainerPATCH 1/5 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.
--- drivers/net/bonding/bond_main.c | 4 +--- drivers/net/team/team_core.c | 3 +-- include/linux/netdev_features.h | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/bonding/bond_main.c +1 -3
@@ -1520,9 +1520,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,struct slave *slave; mask = features; - - features &= ~NETIF_F_ONE_FOR_ALL ; - features |=NETIF_F_ALL_FOR_ALL ; + features =netdev_base_features (features);bond_for_each_slave (bond, slave, iter) { features = netdev_increment_features(features,
drivers/net/team/team_core.c +1 -2
@@ -2011,8 +2011,7 @@ static netdev_features_t team_fix_features(struct net_device *dev,netdev_features_t mask; mask = features; - features &= ~NETIF_F_ONE_FOR_ALL ; - features |=NETIF_F_ALL_FOR_ALL ; + features =netdev_base_features (features);rcu_read_lock ();list_for_each_entry_rcu (port, &team->port_list, list) {
include/linux/netdev_features.h +7 -0
@@ -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 */
Signature · 1 line
2.43.0
Daniel Borkmann
maintainerPATCH 2/5 bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features
If a bonding device has slave devices, then the current logic to derive the feature set for the master bond device is limited in that flags which are fully supported by the underlying slave devices cannot be propagated up to vlan devices which sit on top of bond devices. Instead, these get blindly masked out via current NETIF_F_ALL_FOR_ALL logic.
vlan_features and mpls_features should reuse netdev_base_features() in order derive the set in the same way as ndo_fix_features before iterating through the slave devices to refine the feature set.
--- drivers/net/bonding/bond_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +3 -2
@@ -1563,8 +1563,9 @@ static void bond_compute_features(struct bonding *bond)if (!bond_has_slaves (bond)) goto done; - vlan_features &=NETIF_F_ALL_FOR_ALL ; - mpls_features &=NETIF_F_ALL_FOR_ALL ; + + vlan_features =netdev_base_features (vlan_features); + mpls_features =netdev_base_features (mpls_features);bond_for_each_slave (bond, slave, iter) { vlan_features = netdev_increment_features(vlan_features,
Signature · 1 line
2.43.0
Re: [PATCH net 2/5] bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features
Quoted 26 lines · Daniel Borkmann
If a bonding device has slave devices, then the current logic to derive the feature set for the master bond device is limited in that flags which are fully supported by the underlying slave devices cannot be propagated up to vlan devices which sit on top of bond devices. Instead, these get blindly masked out via current
NETIF_F_ALL_FOR_ALLlogic.
vlan_featuresandmpls_featuresshould reusenetdev_base_features()in order derive the set in the same way asndo_fix_featuresbefore iterating through the slave devices to refine the feature set.Fixes a9b3ace44c7d ("bonding: fix vlan_features computing")Fixes 2e770b507ccd ("net: bonding: Inherit MPLS features from slave devices")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/bonding/bond_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/bonding/bond_main.c +0
-0@@ -1563,8 +1563,9 @@ static void bond_compute_features(struct bonding *bond)
drivers/net/bonding/bond_main.c static void bond_compute_features(struct bonding *bond) · line 1571
Quoted 10 lines
drivers/net/bonding/bond_main.c +3
-2if (!bond_has_slaves (bond)) goto done; - vlan_features &=NETIF_F_ALL_FOR_ALL ; - mpls_features &=NETIF_F_ALL_FOR_ALL ; + + vlan_features =netdev_base_features (vlan_features); + mpls_features =netdev_base_features (mpls_features);bond_for_each_slave (bond, slave, iter) { vlan_features = netdev_increment_features(vlan_features,
Re: [PATCH net 2/5] bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features
In reply to Daniel BorkmannQuoted 39 lines · Daniel Borkmann
If a bonding device has slave devices, then the current logic to derive the feature set for the master bond device is limited in that flags which are fully supported by the underlying slave devices cannot be propagated up to vlan devices which sit on top of bond devices. Instead, these get blindly masked out via current
NETIF_F_ALL_FOR_ALLlogic.
vlan_featuresandmpls_featuresshould reusenetdev_base_features()in order derive the set in the same way asndo_fix_featuresbefore iterating through the slave devices to refine the feature set.Fixes a9b3ace44c7d ("bonding: fix vlan_features computing")Fixes 2e770b507ccd ("net: bonding: Inherit MPLS features from slave devices")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/bonding/bond_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/bonding/bond_main.c +3
-2@@ -1563,8 +1563,9 @@ static void bond_compute_features(struct bonding *bond)if (!bond_has_slaves (bond)) goto done; - vlan_features &=NETIF_F_ALL_FOR_ALL ; - mpls_features &=NETIF_F_ALL_FOR_ALL ; + + vlan_features =netdev_base_features (vlan_features); + mpls_features =netdev_base_features (mpls_features);bond_for_each_slave (bond, slave, iter) { vlan_features = netdev_increment_features(vlan_features,Signature · 1 line
2.43.0
Daniel Borkmann
maintainerPATCH 3/5 bonding: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL
In reply to Daniel BorkmannDrivers like mlx5 expose NIC's vlan_features such as NETIF_F_GSO_UDP_TUNNEL & NETIF_F_GSO_UDP_TUNNEL_CSUM which are later not propagated when the underlying devices are bonded and a vlan device created on top of the bond.
Right now, the more cumbersome workaround for this is to create the vlan on top of the mlx5 and then enslave the vlan devices to a bond.
To fix this, add NETIF_F_GSO_ENCAP_ALL to BOND_VLAN_FEATURES such that bond_compute_features() can probe and propagate the vlan_features from the slave devices up to the vlan device.
Given the following bond:
# ethtool -i enp2s0f{0,1}np{0,1}
driver: mlx5_core
[...]# ethtool -k enp2s0f0np0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off
# ethtool -k enp2s0f1np1 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off
# ethtool -k bond0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: off
Before:
# ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: off [requested on] tx-udp_tnl-csum-segmentation: off [requested on] tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: off
After:
# ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: off
Various users have run into this reporting performance issues when configuring Cilium in vxlan tunneling mode and having the combination of bond & vlan for the core devices connecting the Kubernetes cluster to the outside world.
--- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/bonding/bond_main.c +1 -0
@@ -1534,6 +1534,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,#define BOND_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ + NETIF_F_GSO_ENCAP_ALL | \ NETIF_F_HIGHDMA | NETIF_F_LRO)#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
Signature · 1 line
2.43.0
Re: [PATCH net 3/5] bonding: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL
Quoted 63 lines · Daniel Borkmann
Drivers like mlx5 expose NIC's
vlan_featuressuch asNETIF_F_GSO_UDP_TUNNEL&NETIF_F_GSO_UDP_TUNNEL_CSUMwhich are later not propagated when the underlying devices are bonded and a vlan device created on top of the bond.Right now, the more cumbersome workaround for this is to create the vlan on top of the mlx5 and then enslave the vlan devices to a bond.
To fix this, add
NETIF_F_GSO_ENCAP_ALLtoBOND_VLAN_FEATURESsuch thatbond_compute_features()can probe and propagate thevlan_featuresfrom the slave devices up to the vlan device.Given the following bond:
# ethtool -i enp2s0f{0,1}np{0,1} driver: mlx5_core [...]# ethtool -k enp2s0f0np0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off# ethtool -k enp2s0f1np1 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off# ethtool -k bond0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: offBefore:
# ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: off [requested on] tx-udp_tnl-csum-segmentation: off [requested on] tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: offAfter:
# ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: offVarious users have run into this reporting performance issues when configuring Cilium in vxlan tunneling mode and having the combination of bond & vlan for the core devices connecting the Kubernetes cluster to the outside world.
Quoted 9 lines
Fixes a9b3ace44c7d ("bonding: fix vlan_features computing")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+)
Indeed, I've tested a similar change a year ago to get the expected performance.
Re: [PATCH net 3/5] bonding: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL
In reply to Daniel BorkmannQuoted 87 lines · Daniel Borkmann
Drivers like mlx5 expose NIC's
vlan_featuressuch asNETIF_F_GSO_UDP_TUNNEL&NETIF_F_GSO_UDP_TUNNEL_CSUMwhich are later not propagated when the underlying devices are bonded and a vlan device created on top of the bond.Right now, the more cumbersome workaround for this is to create the vlan on top of the mlx5 and then enslave the vlan devices to a bond.
To fix this, add
NETIF_F_GSO_ENCAP_ALLtoBOND_VLAN_FEATURESsuch thatbond_compute_features()can probe and propagate thevlan_featuresfrom the slave devices up to the vlan device.Given the following bond:
# ethtool -i enp2s0f{0,1}np{0,1} driver: mlx5_core [...]# ethtool -k enp2s0f0np0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off# ethtool -k enp2s0f1np1 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: on rx-udp-gro-forwarding: off# ethtool -k bond0 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: offBefore:
# ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: off [requested on] tx-udp_tnl-csum-segmentation: off [requested on] tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: offAfter:
# ethtool -k bond0.100 | grep udp tx-udp_tnl-segmentation: on tx-udp_tnl-csum-segmentation: on tx-udp-segmentation: on rx-udp_tunnel-port-offload: off [fixed] rx-udp-gro-forwarding: offVarious users have run into this reporting performance issues when configuring Cilium in vxlan tunneling mode and having the combination of bond & vlan for the core devices connecting the Kubernetes cluster to the outside world.
Fixes a9b3ace44c7d ("bonding: fix vlan_features computing")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+)drivers/net/bonding/bond_main.c +1
-0@@ -1534,6 +1534,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,#define BOND_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ + NETIF_F_GSO_ENCAP_ALL | \ NETIF_F_HIGHDMA | NETIF_F_LRO)#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \Signature · 1 line
2.43.0
Daniel Borkmann
maintainerPATCH 4/5 team: Fix initial vlan_feature set in __team_compute_features
In reply to Daniel BorkmannSimilarly as with bonding, fix the calculation of vlan_features to reuse netdev_base_features() in order derive the set in the same way as ndo_fix_features before iterating through the slave devices to refine the feature set.
--- drivers/net/team/team_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/team/team_core.c +3 -2
@@ -991,13 +991,14 @@ static void team_port_disable(struct team *team,static void __team_compute_features (struct team *team) {struct team_port *port; -netdev_features_t vlan_features =TEAM_VLAN_FEATURES & -NETIF_F_ALL_FOR_ALL ; +netdev_features_t vlan_features =TEAM_VLAN_FEATURES ;netdev_features_t enc_features =TEAM_ENC_FEATURES ;unsigned short max_hard_header_len =ETH_HLEN ;unsigned int dst_release_flag =IFF_XMIT_DST_RELEASE |IFF_XMIT_DST_RELEASE_PERM ; + vlan_features =netdev_base_features (vlan_features); +rcu_read_lock ();list_for_each_entry_rcu (port, &team->port_list, list) { vlan_features = netdev_increment_features(vlan_features,
Signature · 1 line
2.43.0
Re: [PATCH net 4/5] team: Fix initial vlan_feature set in __team_compute_features
Quoted 25 lines · Daniel Borkmann
Similarly as with bonding, fix the calculation of
vlan_featuresto reusenetdev_base_features()in order derive the set in the same way asndo_fix_featuresbefore iterating through the slave devices to refine the feature set.Fixes 3625920b62c3 ("teaming: fix vlan_features computing")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/team/team_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/team/team_core.c +1
-2@@ -991,13 +991,14 @@ static void team_port_disable(struct team *team,static void __team_compute_features (struct team *team) {struct team_port *port; -netdev_features_t vlan_features =TEAM_VLAN_FEATURES & -NETIF_F_ALL_FOR_ALL ; +netdev_features_t vlan_features =TEAM_VLAN_FEATURES ;
drivers/net/team/team_core.c static void team_port_disable(struct team *team, · line 1004
Quoted 10 lines
drivers/net/team/team_core.c +2
-0netdev_features_t enc_features =TEAM_ENC_FEATURES ;unsigned short max_hard_header_len =ETH_HLEN ;unsigned int dst_release_flag =IFF_XMIT_DST_RELEASE |IFF_XMIT_DST_RELEASE_PERM ; + vlan_features =netdev_base_features (vlan_features); +rcu_read_lock ();list_for_each_entry_rcu (port, &team->port_list, list) { vlan_features = netdev_increment_features(vlan_features,
Re: [PATCH net 4/5] team: Fix initial vlan_feature set in __team_compute_features
In reply to Daniel BorkmannQuoted 38 lines · Daniel Borkmann
Similarly as with bonding, fix the calculation of
vlan_featuresto reusenetdev_base_features()in order derive the set in the same way asndo_fix_featuresbefore iterating through the slave devices to refine the feature set.Fixes 3625920b62c3 ("teaming: fix vlan_features computing")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/team/team_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/team/team_core.c +3
-2@@ -991,13 +991,14 @@ static void team_port_disable(struct team *team,static void __team_compute_features (struct team *team) {struct team_port *port; -netdev_features_t vlan_features =TEAM_VLAN_FEATURES & -NETIF_F_ALL_FOR_ALL ; +netdev_features_t vlan_features =TEAM_VLAN_FEATURES ;netdev_features_t enc_features =TEAM_ENC_FEATURES ;unsigned short max_hard_header_len =ETH_HLEN ;unsigned int dst_release_flag =IFF_XMIT_DST_RELEASE |IFF_XMIT_DST_RELEASE_PERM ; + vlan_features =netdev_base_features (vlan_features); +rcu_read_lock ();list_for_each_entry_rcu (port, &team->port_list, list) { vlan_features = netdev_increment_features(vlan_features,Signature · 1 line
2.43.0
Daniel Borkmann
maintainerPATCH 5/5 team: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL
In reply to Daniel BorkmannSimilar to bonding driver, add NETIF_F_GSO_ENCAP_ALL to TEAM_VLAN_FEATURES in order to support slave devices which propagate NETIF_F_GSO_UDP_TUNNEL & NETIF_F_GSO_UDP_TUNNEL_CSUM as vlan_features.
--- drivers/net/team/team_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/team/team_core.c +2 -1
@@ -983,7 +983,8 @@ static void team_port_disable(struct team *team,#define TEAM_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_HIGHDMA | NETIF_F_LRO) + NETIF_F_HIGHDMA | NETIF_F_LRO | \ + NETIF_F_GSO_ENCAP_ALL)#define TEAM_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE)
Signature · 1 line
2.43.0
Re: [PATCH net 5/5] team: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL
Quoted 18 lines · Daniel Borkmann
Similar to bonding driver, add
NETIF_F_GSO_ENCAP_ALLtoTEAM_VLAN_FEATURESin order to support slave devices which propagateNETIF_F_GSO_UDP_TUNNEL&NETIF_F_GSO_UDP_TUNNEL_CSUMasvlan_features.Fixes 3625920b62c3 ("teaming: fix vlan_features computing")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/team/team_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/team/team_core.c +0
-0
drivers/net/team/team_core.c static void team_port_disable(struct team *team, · line 990
Quoted 9 lines
drivers/net/team/team_core.c +2
-1@@ -983,7 +983,8 @@ static void team_port_disable(struct team *team,#define TEAM_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_HIGHDMA | NETIF_F_LRO) + NETIF_F_HIGHDMA | NETIF_F_LRO | \ + NETIF_F_GSO_ENCAP_ALL)#define TEAM_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE)
Re: [PATCH net 5/5] team: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL
In reply to Daniel BorkmannQuoted 30 lines · Daniel Borkmann
Similar to bonding driver, add
NETIF_F_GSO_ENCAP_ALLtoTEAM_VLAN_FEATURESin order to support slave devices which propagateNETIF_F_GSO_UDP_TUNNEL&NETIF_F_GSO_UDP_TUNNEL_CSUMasvlan_features.Fixes 3625920b62c3 ("teaming: fix vlan_features computing")Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/team/team_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/team/team_core.c +2
-1@@ -983,7 +983,8 @@ static void team_port_disable(struct team *team,#define TEAM_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_HIGHDMA | NETIF_F_LRO) + NETIF_F_HIGHDMA | NETIF_F_LRO | \ + NETIF_F_GSO_ENCAP_ALL)#define TEAM_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE)Signature · 1 line
2.43.0
Quoted 65 lines · Daniel Borkmann
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 <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>--- drivers/net/bonding/bond_main.c | 4 +--- drivers/net/team/team_core.c | 3 +-- include/linux/netdev_features.h | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-)drivers/net/bonding/bond_main.c +1
-3@@ -1520,9 +1520,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,struct slave *slave; mask = features; - - features &= ~NETIF_F_ONE_FOR_ALL ; - features |=NETIF_F_ALL_FOR_ALL ; + features =netdev_base_features (features);bond_for_each_slave (bond, slave, iter) { features = netdev_increment_features(features,drivers/net/team/team_core.c +1
-2@@ -2011,8 +2011,7 @@ static netdev_features_t team_fix_features(struct net_device *dev,netdev_features_t mask; mask = features; - features &= ~NETIF_F_ONE_FOR_ALL ; - features |=NETIF_F_ALL_FOR_ALL ; + features =netdev_base_features (features);rcu_read_lock ();list_for_each_entry_rcu (port, &team->port_list, list) {include/linux/netdev_features.h +7
-0@@ -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 */ Signature · 1 line
2.43.0
Quoted 11 lines · Daniel Borkmann
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 <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>
Quoted 6 lines
--- drivers/net/bonding/bond_main.c | 4 +--- drivers/net/team/team_core.c | 3 +-- include/linux/netdev_features.h | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-)
Paolo Abeni
maintainerQuoted 11 lines · Daniel Borkmann
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 <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>
The series looks good, I'm applying it right now, but please include a (even small) cover letter in the next multi-patch submission, thanks!
Paolo
Daniel Borkmann
maintainerQuoted 8 lines · Paolo Abeni
Quoted 7 lines · Daniel Borkmann
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.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Daniel Borkmann <[email protected]>Cc Nikolay Aleksandrov <[email protected]>Cc Ido Schimmel <[email protected]>Cc Jiri Pirko <[email protected]>The series looks good, I'm applying it right now, but please include a (even small) cover letter in the next multi-patch submission, thanks!
Ok, thanks, will do next time!
Cheers,
Daniel
This series was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Tue, 10 Dec 2024 15:12:41 +0100 you wrote:
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.[...]
Here is the summary with links:
- [net,1/5] net, team, bonding: Add netdev_base_features helper
https://git.kernel.org/netdev/net/c/d2516c3a5370 - [net,2/5] bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features https://git.kernel.org/netdev/net/c/d064ea7fe2a2 - [net,3/5] bonding: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL https://git.kernel.org/netdev/net/c/77b11c8bf3a2 - [net,4/5] team: Fix initial vlan_feature set in __team_compute_features https://git.kernel.org/netdev/net/c/396699ac2cb1 - [net,5/5] team: Fix feature propagation of NETIF_F_GSO_ENCAP_ALL https://git.kernel.org/netdev/net/c/98712844589e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html