1 From 93332f2f5d26edaa68a84efce92339022c195cd4 Mon Sep 17 00:00:00 2001
2 From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
3 Date: Wed, 21 Nov 2012 04:35:03 +0000
4 Subject: bonding: Bonding driver does not consider the gso_max_size/gso_max_segs setting of slave devices.
7 From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
9 [ Upstream commit 0e376bd0b791ac6ac6bdb051492df0769c840848 ]
11 Patch sets the lowest gso_max_size and gso_max_segs values of the slave devices during enslave and detach.
13 Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
14 Acked-by: Eric Dumazet <edumazet@google.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 drivers/net/bonding/bond_main.c | 7 +++++++
19 1 file changed, 7 insertions(+)
21 --- a/drivers/net/bonding/bond_main.c
22 +++ b/drivers/net/bonding/bond_main.c
23 @@ -1439,6 +1439,8 @@ static void bond_compute_features(struct
24 struct net_device *bond_dev = bond->dev;
25 u32 vlan_features = BOND_VLAN_FEATURES;
26 unsigned short max_hard_header_len = ETH_HLEN;
27 + unsigned int gso_max_size = GSO_MAX_SIZE;
28 + u16 gso_max_segs = GSO_MAX_SEGS;
31 read_lock(&bond->lock);
32 @@ -1452,11 +1454,16 @@ static void bond_compute_features(struct
34 if (slave->dev->hard_header_len > max_hard_header_len)
35 max_hard_header_len = slave->dev->hard_header_len;
37 + gso_max_size = min(gso_max_size, slave->dev->gso_max_size);
38 + gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs);
42 bond_dev->vlan_features = vlan_features;
43 bond_dev->hard_header_len = max_hard_header_len;
44 + bond_dev->gso_max_segs = gso_max_segs;
45 + netif_set_gso_max_size(bond_dev, gso_max_size);
47 read_unlock(&bond->lock);