Skip to content

Commit

Permalink
bonding: Fix initial {vlan,mpls}_feature set in bond_compute_features
Browse files Browse the repository at this point in the history
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.

Fixes: a9b3ace ("bonding: fix vlan_features computing")
Fixes: 2e770b5 ("net: bonding: Inherit MPLS features from slave devices")
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: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20241210141245.327886-2-daniel@iogearbox.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Daniel Borkmann authored and Paolo Abeni committed Dec 12, 2024
1 parent d2516c3 commit d064ea7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d064ea7

Please sign in to comment.