aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-07-17 08:19:48 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-18 12:31:25 -0400
commitb6fe83e9525a03b3141e5857eb7d8af219db94e5 (patch)
treeabdd0d6dc72d1c9a30108f8be1e8dc9dcb5d315e /drivers/net/bonding
parent1817e83d6ccf992164dd83522b2d1c22b1a85977 (diff)
bonding: refine IFF_XMIT_DST_RELEASE capability
Some workloads greatly benefit of IFF_XMIT_DST_RELEASE capability on output net device, avoiding dirtying dst refcount. bonding currently disables IFF_XMIT_DST_RELEASE unconditionally. If all slaves have the IFF_XMIT_DST_RELEASE bit set, then bonding master can also have it in its priv_flags Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Jay Vosburgh <fubar@us.ibm.com> Cc: Andy Gospodarek <andy@greyhouse.net> Cc: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1eb3979d0af5..3960b1b26178 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1382,6 +1382,7 @@ static void bond_compute_features(struct bonding *bond)
1382 netdev_features_t vlan_features = BOND_VLAN_FEATURES; 1382 netdev_features_t vlan_features = BOND_VLAN_FEATURES;
1383 unsigned short max_hard_header_len = ETH_HLEN; 1383 unsigned short max_hard_header_len = ETH_HLEN;
1384 int i; 1384 int i;
1385 unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
1385 1386
1386 read_lock(&bond->lock); 1387 read_lock(&bond->lock);
1387 1388
@@ -1392,6 +1393,7 @@ static void bond_compute_features(struct bonding *bond)
1392 vlan_features = netdev_increment_features(vlan_features, 1393 vlan_features = netdev_increment_features(vlan_features,
1393 slave->dev->vlan_features, BOND_VLAN_FEATURES); 1394 slave->dev->vlan_features, BOND_VLAN_FEATURES);
1394 1395
1396 dst_release_flag &= slave->dev->priv_flags;
1395 if (slave->dev->hard_header_len > max_hard_header_len) 1397 if (slave->dev->hard_header_len > max_hard_header_len)
1396 max_hard_header_len = slave->dev->hard_header_len; 1398 max_hard_header_len = slave->dev->hard_header_len;
1397 } 1399 }
@@ -1400,6 +1402,9 @@ done:
1400 bond_dev->vlan_features = vlan_features; 1402 bond_dev->vlan_features = vlan_features;
1401 bond_dev->hard_header_len = max_hard_header_len; 1403 bond_dev->hard_header_len = max_hard_header_len;
1402 1404
1405 flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
1406 bond_dev->priv_flags = flags | dst_release_flag;
1407
1403 read_unlock(&bond->lock); 1408 read_unlock(&bond->lock);
1404 1409
1405 netdev_change_features(bond_dev); 1410 netdev_change_features(bond_dev);