Message ID | 1435279556-29812-1-git-send-email-rafael.tinoco@canonical.com |
---|---|
State | New |
Headers | show |
On Thu, Jun 25, 2015 at 09:45:56PM -0300, Rafael David Tinoco wrote: > BugLink: https://bugs.launchpad.net/bugs/1432848 > > Packets which are sent from the selftest (ethtool) flow, > should not be passed to GRO stack but rather dropped by > the driver after validation. To achieve that, we disable > GRO for the duration of the selftest. > > Fixes: dd65beac48a5 ("net/mlx4_en: Extend usage of napi_gro_frags") > Reported-by: Carol Soto <clsoto@linux.vnet.ibm.com> > OriginalAuthor: Ido Shamay <idos@mellanox.com> > (backported from commit 1037ebbbd262227a91dfdd558159e345d4edf6b7 upstream) > Signed-off-by: Ido Shamay <idos@mellanox.com> > Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> > Signed-off-by: David S. Miller <davem@davemloft.net> > Signed-off-by: Rafael David Tinoco <rafael.tinoco@canonical.com> > --- > drivers/net/ethernet/mellanox/mlx4/en_selftest.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c > index 2d8ee66..a61009f 100644 > --- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c > +++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c > @@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv) > { > u32 loopback_ok = 0; > int i; > - > + bool gro_enabled; > > priv->loopback_ok = 0; > priv->validate_loopback = 1; > + gro_enabled = priv->dev->features & NETIF_F_GRO; > > mlx4_en_update_loopback_state(priv->dev, priv->dev->features); > + priv->dev->features &= ~NETIF_F_GRO; > > /* xmit */ > if (mlx4_en_test_loopback_xmit(priv)) { > @@ -108,6 +110,10 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv) > mlx4_en_test_loopback_exit: > > priv->validate_loopback = 0; > + > + if (gro_enabled) > + priv->dev->features |= NETIF_F_GRO; > + > mlx4_en_update_loopback_state(priv->dev, priv->dev->features); > return !loopback_ok; > } > -- > 2.1.4 > > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team 1. Clean backport. 2. Positive testing.
Only affect 3.19 kernels, looks reasonable. --chris On Fri, Jun 26, 2015 at 09:30:56AM -0700, Brad Figg wrote: > On Thu, Jun 25, 2015 at 09:45:56PM -0300, Rafael David Tinoco wrote: > > BugLink: https://bugs.launchpad.net/bugs/1432848 > > > > Packets which are sent from the selftest (ethtool) flow, > > should not be passed to GRO stack but rather dropped by > > the driver after validation. To achieve that, we disable > > GRO for the duration of the selftest. > > > > Fixes: dd65beac48a5 ("net/mlx4_en: Extend usage of napi_gro_frags") > > Reported-by: Carol Soto <clsoto@linux.vnet.ibm.com> > > OriginalAuthor: Ido Shamay <idos@mellanox.com> > > (backported from commit 1037ebbbd262227a91dfdd558159e345d4edf6b7 upstream) > > Signed-off-by: Ido Shamay <idos@mellanox.com> > > Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> > > Signed-off-by: David S. Miller <davem@davemloft.net> > > Signed-off-by: Rafael David Tinoco <rafael.tinoco@canonical.com> > > --- > > drivers/net/ethernet/mellanox/mlx4/en_selftest.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c > > index 2d8ee66..a61009f 100644 > > --- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c > > +++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c > > @@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv) > > { > > u32 loopback_ok = 0; > > int i; > > - > > + bool gro_enabled; > > > > priv->loopback_ok = 0; > > priv->validate_loopback = 1; > > + gro_enabled = priv->dev->features & NETIF_F_GRO; > > > > mlx4_en_update_loopback_state(priv->dev, priv->dev->features); > > + priv->dev->features &= ~NETIF_F_GRO; > > > > /* xmit */ > > if (mlx4_en_test_loopback_xmit(priv)) { > > @@ -108,6 +110,10 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv) > > mlx4_en_test_loopback_exit: > > > > priv->validate_loopback = 0; > > + > > + if (gro_enabled) > > + priv->dev->features |= NETIF_F_GRO; > > + > > mlx4_en_update_loopback_state(priv->dev, priv->dev->features); > > return !loopback_ok; > > } > > -- > > 2.1.4 > > > > > > -- > > kernel-team mailing list > > kernel-team@lists.ubuntu.com > > https://lists.ubuntu.com/mailman/listinfo/kernel-team > > 1. Clean backport. > 2. Positive testing. > > -- > Brad Figg brad.figg@canonical.com http://www.canonical.com > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team >
Applied to the Vivid master-next branch.
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c index 2d8ee66..a61009f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c @@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv) { u32 loopback_ok = 0; int i; - + bool gro_enabled; priv->loopback_ok = 0; priv->validate_loopback = 1; + gro_enabled = priv->dev->features & NETIF_F_GRO; mlx4_en_update_loopback_state(priv->dev, priv->dev->features); + priv->dev->features &= ~NETIF_F_GRO; /* xmit */ if (mlx4_en_test_loopback_xmit(priv)) { @@ -108,6 +110,10 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv) mlx4_en_test_loopback_exit: priv->validate_loopback = 0; + + if (gro_enabled) + priv->dev->features |= NETIF_F_GRO; + mlx4_en_update_loopback_state(priv->dev, priv->dev->features); return !loopback_ok; }