Skip to content

Commit e78c20f

Browse files
borkmannkuba-moo
authored andcommitted
team: Fix feature exposure when no ports are present
Small follow-up to align this to an equivalent behavior as the bond driver. The change in 3625920 ("teaming: fix vlan_features computing") removed the netdevice vlan_features when there is no team port attached, yet it leaves the full set of enc_features intact. Instead, leave the default features as pre 3625920, and recompute once we do have ports attached. Also, similarly as in bonding case, call the netdev_base_features() helper on the enc_features. Fixes: 3625920 ("teaming: fix vlan_features computing") Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fbbd84a commit e78c20f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/team/team_core.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,9 +998,13 @@ static void __team_compute_features(struct team *team)
998998
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
999999
IFF_XMIT_DST_RELEASE_PERM;
10001000

1001+
rcu_read_lock();
1002+
if (list_empty(&team->port_list))
1003+
goto done;
1004+
10011005
vlan_features = netdev_base_features(vlan_features);
1006+
enc_features = netdev_base_features(enc_features);
10021007

1003-
rcu_read_lock();
10041008
list_for_each_entry_rcu(port, &team->port_list, list) {
10051009
vlan_features = netdev_increment_features(vlan_features,
10061010
port->dev->vlan_features,
@@ -1010,11 +1014,11 @@ static void __team_compute_features(struct team *team)
10101014
port->dev->hw_enc_features,
10111015
TEAM_ENC_FEATURES);
10121016

1013-
10141017
dst_release_flag &= port->dev->priv_flags;
10151018
if (port->dev->hard_header_len > max_hard_header_len)
10161019
max_hard_header_len = port->dev->hard_header_len;
10171020
}
1021+
done:
10181022
rcu_read_unlock();
10191023

10201024
team->dev->vlan_features = vlan_features;

0 commit comments

Comments
 (0)