aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_main.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 070b78d959cc..1afda3230def 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1202,43 +1202,35 @@ static int bond_sethwaddr(struct net_device *bond_dev,
1202 return 0; 1202 return 0;
1203} 1203}
1204 1204
1205#define BOND_INTERSECT_FEATURES \ 1205#define BOND_VLAN_FEATURES \
1206 (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_TSO | NETIF_F_UFO) 1206 (NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX | \
1207 NETIF_F_HW_VLAN_FILTER)
1207 1208
1208/* 1209/*
1209 * Compute the common dev->feature set available to all slaves. Some 1210 * Compute the common dev->feature set available to all slaves. Some
1210 * feature bits are managed elsewhere, so preserve feature bits set on 1211 * feature bits are managed elsewhere, so preserve those feature bits
1211 * master device that are not part of the examined set. 1212 * on the master device.
1212 */ 1213 */
1213static int bond_compute_features(struct bonding *bond) 1214static int bond_compute_features(struct bonding *bond)
1214{ 1215{
1215 unsigned long features = BOND_INTERSECT_FEATURES;
1216 struct slave *slave; 1216 struct slave *slave;
1217 struct net_device *bond_dev = bond->dev; 1217 struct net_device *bond_dev = bond->dev;
1218 unsigned long features = bond_dev->features;
1218 unsigned short max_hard_header_len = ETH_HLEN; 1219 unsigned short max_hard_header_len = ETH_HLEN;
1219 int i; 1220 int i;
1220 1221
1222 features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES);
1223 features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
1224 NETIF_F_GSO_MASK | NETIF_F_NO_CSUM;
1225
1221 bond_for_each_slave(bond, slave, i) { 1226 bond_for_each_slave(bond, slave, i) {
1222 features &= (slave->dev->features & BOND_INTERSECT_FEATURES); 1227 features = netdev_compute_features(features,
1228 slave->dev->features);
1223 if (slave->dev->hard_header_len > max_hard_header_len) 1229 if (slave->dev->hard_header_len > max_hard_header_len)
1224 max_hard_header_len = slave->dev->hard_header_len; 1230 max_hard_header_len = slave->dev->hard_header_len;
1225 } 1231 }
1226 1232
1227 if ((features & NETIF_F_SG) && 1233 features |= (bond_dev->features & BOND_VLAN_FEATURES);
1228 !(features & NETIF_F_ALL_CSUM))
1229 features &= ~NETIF_F_SG;
1230
1231 /*
1232 * features will include NETIF_F_TSO (NETIF_F_UFO) iff all
1233 * slave devices support NETIF_F_TSO (NETIF_F_UFO), which
1234 * implies that all slaves also support scatter-gather
1235 * (NETIF_F_SG), which implies that features also includes
1236 * NETIF_F_SG. So no need to check whether we have an
1237 * illegal combination of NETIF_F_{TSO,UFO} and
1238 * !NETIF_F_SG
1239 */
1240
1241 features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
1242 bond_dev->features = features; 1234 bond_dev->features = features;
1243 bond_dev->hard_header_len = max_hard_header_len; 1235 bond_dev->hard_header_len = max_hard_header_len;
1244 1236