diff options
author | Roopa Prabhu <roopa@cumulusnetworks.com> | 2015-01-30 01:40:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-02 02:16:34 -0500 |
commit | c158cba38ccd6e7c7787a6ec904d97b9d22537f5 (patch) | |
tree | f6e98cb116d28f330c6328dafbaf6fb328ec4f71 | |
parent | eb0ac4207f2db7245f07606a2b7929e604b875bd (diff) |
bonding: handle NETIF_F_HW_SWITCH_OFFLOAD flag and add ndo_bridge_setlink/dellink handlers
We want bond to pick up the offload flag if any of its slaves have it.
NETIF_F_HW_SWITCH_OFFLOAD flag is added to the mask, so that
netdev_increment_features does not ignore it.
This also adds ndo_bridge_setlink and ndo_bridge_dellink handlers.
These currently point to the default handlers provided by the
switchdev api.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bonding/bond_main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e229a8657de8..c9e519cb9214 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -77,6 +77,7 @@ | |||
77 | #include <net/pkt_sched.h> | 77 | #include <net/pkt_sched.h> |
78 | #include <linux/rculist.h> | 78 | #include <linux/rculist.h> |
79 | #include <net/flow_keys.h> | 79 | #include <net/flow_keys.h> |
80 | #include <net/switchdev.h> | ||
80 | #include <net/bonding.h> | 81 | #include <net/bonding.h> |
81 | #include <net/bond_3ad.h> | 82 | #include <net/bond_3ad.h> |
82 | #include <net/bond_alb.h> | 83 | #include <net/bond_alb.h> |
@@ -979,7 +980,11 @@ static netdev_features_t bond_fix_features(struct net_device *dev, | |||
979 | netdev_features_t mask; | 980 | netdev_features_t mask; |
980 | struct slave *slave; | 981 | struct slave *slave; |
981 | 982 | ||
982 | mask = features; | 983 | /* If any slave has the offload feature flag set, |
984 | * set the offload flag on the bond. | ||
985 | */ | ||
986 | mask = features | NETIF_F_HW_SWITCH_OFFLOAD; | ||
987 | |||
983 | features &= ~NETIF_F_ONE_FOR_ALL; | 988 | features &= ~NETIF_F_ONE_FOR_ALL; |
984 | features |= NETIF_F_ALL_FOR_ALL; | 989 | features |= NETIF_F_ALL_FOR_ALL; |
985 | 990 | ||
@@ -3952,6 +3957,8 @@ static const struct net_device_ops bond_netdev_ops = { | |||
3952 | .ndo_add_slave = bond_enslave, | 3957 | .ndo_add_slave = bond_enslave, |
3953 | .ndo_del_slave = bond_release, | 3958 | .ndo_del_slave = bond_release, |
3954 | .ndo_fix_features = bond_fix_features, | 3959 | .ndo_fix_features = bond_fix_features, |
3960 | .ndo_bridge_setlink = ndo_dflt_netdev_switch_port_bridge_setlink, | ||
3961 | .ndo_bridge_dellink = ndo_dflt_netdev_switch_port_bridge_dellink, | ||
3955 | }; | 3962 | }; |
3956 | 3963 | ||
3957 | static const struct device_type bond_type = { | 3964 | static const struct device_type bond_type = { |