Comment 11 for bug 1078184

Revision history for this message
Sarveshwar Bandi (sarveshwar-bandi) wrote :

The following patch for bonding driver has been accepted upstream (net tree) and needs to be pulled into ubuntu.

From: Sarveshwar Bandi <email address hidden>

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 <email address hidden>
---
 drivers/net/bonding/bond_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b2530b0..5f5b69f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1379,6 +1379,8 @@ static void bond_compute_features(struct bonding *bond)
  struct net_device *bond_dev = bond->dev;
  netdev_features_t 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;
  unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;

@@ -1394,11 +1396,16 @@ static void bond_compute_features(struct bonding *bond)
   dst_release_flag &= slave->dev->priv_flags;
   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);

  flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
  bond_dev->priv_flags = flags | dst_release_flag;
--
1.7.9.5