diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-11-16 23:16:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-18 14:54:59 -0500 |
commit | 234a8fd49d086f5a3debb379bfdf4e6b51f0c0e2 (patch) | |
tree | 4ce3c4becc8f6b5ec0dd690f27569b25741b6f90 | |
parent | bdb6e697b2a76c541960b86ab8fda88f3de1adf2 (diff) |
team: add fix_features
do fix features in similar way as bonding code does
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/team/team.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index f3092749b072..5b169c18aaf6 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -953,6 +953,27 @@ static int team_del_slave(struct net_device *dev, struct net_device *port_dev) | |||
953 | return err; | 953 | return err; |
954 | } | 954 | } |
955 | 955 | ||
956 | static netdev_features_t team_fix_features(struct net_device *dev, | ||
957 | netdev_features_t features) | ||
958 | { | ||
959 | struct team_port *port; | ||
960 | struct team *team = netdev_priv(dev); | ||
961 | netdev_features_t mask; | ||
962 | |||
963 | mask = features; | ||
964 | features &= ~NETIF_F_ONE_FOR_ALL; | ||
965 | features |= NETIF_F_ALL_FOR_ALL; | ||
966 | |||
967 | rcu_read_lock(); | ||
968 | list_for_each_entry_rcu(port, &team->port_list, list) { | ||
969 | features = netdev_increment_features(features, | ||
970 | port->dev->features, | ||
971 | mask); | ||
972 | } | ||
973 | rcu_read_unlock(); | ||
974 | return features; | ||
975 | } | ||
976 | |||
956 | static const struct net_device_ops team_netdev_ops = { | 977 | static const struct net_device_ops team_netdev_ops = { |
957 | .ndo_init = team_init, | 978 | .ndo_init = team_init, |
958 | .ndo_uninit = team_uninit, | 979 | .ndo_uninit = team_uninit, |
@@ -968,6 +989,7 @@ static const struct net_device_ops team_netdev_ops = { | |||
968 | .ndo_vlan_rx_kill_vid = team_vlan_rx_kill_vid, | 989 | .ndo_vlan_rx_kill_vid = team_vlan_rx_kill_vid, |
969 | .ndo_add_slave = team_add_slave, | 990 | .ndo_add_slave = team_add_slave, |
970 | .ndo_del_slave = team_del_slave, | 991 | .ndo_del_slave = team_del_slave, |
992 | .ndo_fix_features = team_fix_features, | ||
971 | }; | 993 | }; |
972 | 994 | ||
973 | 995 | ||