Patchwork [Precise] bonding: Bonding driver does not consider the gso_max_size/gso_max_segs setting of slave devices.

login
register
mail settings
Submitter Jesse Sung
Date Nov. 22, 2012, 6:19 a.m.
Message ID <1353565199-2094-1-git-send-email-jesse.sung@canonical.com>
Download mbox | patch
Permalink /patch/201019/
State New
Headers show

Comments

Jesse Sung - Nov. 22, 2012, 6:19 a.m.
From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

BugLink: https://launchpad.net/bugs/1078184

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>
(cherry picked from commit 0e376bd0b791ac6ac6bdb051492df0769c840848)

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 drivers/net/bonding/bond_main.c |    7 +++++++
 1 file changed, 7 insertions(+)
Herton Ronaldo Krzesinski - Nov. 22, 2012, 12:48 p.m.

Stefan Bader - Nov. 22, 2012, 1:24 p.m.
On 22.11.2012 07:19, Jesse Sung wrote:
> From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
> 
> BugLink: https://launchpad.net/bugs/1078184
> 
> 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>
> (cherry picked from commit 0e376bd0b791ac6ac6bdb051492df0769c840848)
> 
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> ---
>  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 6c284d1..202ae34 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);
>  
> 

Ben, might be of interest for 3.2. Not sure you already got it.

-Stefan
Tim Gardner - Nov. 26, 2012, 4:19 p.m.

Ben Hutchings - Dec. 2, 2012, 3:32 a.m.
On Thu, 2012-11-22 at 14:24 +0100, Stefan Bader wrote:
> On 22.11.2012 07:19, Jesse Sung wrote:
> > From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
> > 
> > BugLink: https://launchpad.net/bugs/1078184
> > 
> > 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>
> > (cherry picked from commit 0e376bd0b791ac6ac6bdb051492df0769c840848)
> > 
> > Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> > ---
> >  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 6c284d1..202ae34 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);
> >  
> > 
> 
> Ben, might be of interest for 3.2. Not sure you already got it.

Thanks, but David Miller generally takes care of picking the networking
fixes for stable.

Ben.

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6c284d1..202ae34 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);