summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarveshwar Bandi <sarveshwar.bandi@emulex.com>2012-11-21 04:35:03 +0000
committerBen Hutchings <ben@decadent.org.uk>2013-01-03 03:33:49 +0000
commit12ca0b6bf4aceb39fa0466335698009aa43affa9 (patch)
tree34c6e96c1f8e885e54d3c9ee97ce470a4a92e78e
parent9e6cb78608694a9095be1d731a9a2a5832a4c919 (diff)
downloadlinux-stable-12ca0b6bf4aceb39fa0466335698009aa43affa9.tar.gz
linux-stable-12ca0b6bf4aceb39fa0466335698009aa43affa9.tar.bz2
linux-stable-12ca0b6bf4aceb39fa0466335698009aa43affa9.zip
bonding: Bonding driver does not consider the gso_max_size/gso_max_segs setting of slave devices.
[ Upstream commit 0e376bd0b791ac6ac6bdb051492df0769c840848 ] Patch sets the lowest gso_max_size and gso_max_segs values of the slave devices during enslave and detach. Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/net/bonding/bond_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6c284d12e654..202ae3440d93 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1366,6 +1366,8 @@ static void bond_compute_features(struct bonding *bond)
struct net_device *bond_dev = bond->dev;
u32 vlan_features = BOND_VLAN_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN;
+ unsigned int gso_max_size = GSO_MAX_SIZE;
+ u16 gso_max_segs = GSO_MAX_SEGS;
int i;
read_lock(&bond->lock);
@@ -1379,11 +1381,16 @@ static void bond_compute_features(struct bonding *bond)
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;
+
+ gso_max_size = min(gso_max_size, slave->dev->gso_max_size);
+ gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs);
}
done:
bond_dev->vlan_features = vlan_features;
bond_dev->hard_header_len = max_hard_header_len;
+ bond_dev->gso_max_segs = gso_max_segs;
+ netif_set_gso_max_size(bond_dev, gso_max_size);
read_unlock(&bond->lock);