diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2009-08-28 08:05:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-29 02:01:12 -0400 |
commit | 278339a42a1bcef1fb448d275056d519307e6025 (patch) | |
tree | e8329248e49b1ec3afc97f9cf16a4c8685f32832 | |
parent | c06f51eab8e652abebb698b1ead4c5585f820ef9 (diff) |
bonding: propogate vlan_features to bonding master
Propogate the vlan_features of the slave devices to the bonding
master device, using the same logic as for regular features.
Tested by Or Gerlitz <ogerlitz@voltaire.com>, who also removed
the debug logic from the original test patch.
Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bonding/bond_main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 4798d30c9545..1aeb36c51478 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1331,6 +1331,7 @@ static int bond_compute_features(struct bonding *bond) | |||
1331 | struct slave *slave; | 1331 | struct slave *slave; |
1332 | struct net_device *bond_dev = bond->dev; | 1332 | struct net_device *bond_dev = bond->dev; |
1333 | unsigned long features = bond_dev->features; | 1333 | unsigned long features = bond_dev->features; |
1334 | unsigned long vlan_features = 0; | ||
1334 | unsigned short max_hard_header_len = max((u16)ETH_HLEN, | 1335 | unsigned short max_hard_header_len = max((u16)ETH_HLEN, |
1335 | bond_dev->hard_header_len); | 1336 | bond_dev->hard_header_len); |
1336 | int i; | 1337 | int i; |
@@ -1343,10 +1344,14 @@ static int bond_compute_features(struct bonding *bond) | |||
1343 | 1344 | ||
1344 | features &= ~NETIF_F_ONE_FOR_ALL; | 1345 | features &= ~NETIF_F_ONE_FOR_ALL; |
1345 | 1346 | ||
1347 | vlan_features = bond->first_slave->dev->vlan_features; | ||
1346 | bond_for_each_slave(bond, slave, i) { | 1348 | bond_for_each_slave(bond, slave, i) { |
1347 | features = netdev_increment_features(features, | 1349 | features = netdev_increment_features(features, |
1348 | slave->dev->features, | 1350 | slave->dev->features, |
1349 | NETIF_F_ONE_FOR_ALL); | 1351 | NETIF_F_ONE_FOR_ALL); |
1352 | vlan_features = netdev_increment_features(vlan_features, | ||
1353 | slave->dev->vlan_features, | ||
1354 | NETIF_F_ONE_FOR_ALL); | ||
1350 | if (slave->dev->hard_header_len > max_hard_header_len) | 1355 | if (slave->dev->hard_header_len > max_hard_header_len) |
1351 | max_hard_header_len = slave->dev->hard_header_len; | 1356 | max_hard_header_len = slave->dev->hard_header_len; |
1352 | } | 1357 | } |
@@ -1354,6 +1359,7 @@ static int bond_compute_features(struct bonding *bond) | |||
1354 | done: | 1359 | done: |
1355 | features |= (bond_dev->features & BOND_VLAN_FEATURES); | 1360 | features |= (bond_dev->features & BOND_VLAN_FEATURES); |
1356 | bond_dev->features = netdev_fix_features(features, NULL); | 1361 | bond_dev->features = netdev_fix_features(features, NULL); |
1362 | bond_dev->vlan_features = netdev_fix_features(vlan_features, NULL); | ||
1357 | bond_dev->hard_header_len = max_hard_header_len; | 1363 | bond_dev->hard_header_len = max_hard_header_len; |
1358 | 1364 | ||
1359 | return 0; | 1365 | return 0; |