diff mbox

[3.16.y-ckt,stable] Patch "net/mlx4_en: Avoid changing dev->features directly in run-time" has been added to the 3.16.y-ckt tree

Message ID 1457439926-20818-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques March 8, 2016, 12:25 p.m. UTC
This is a note to let you know that I have just added a patch titled

    net/mlx4_en: Avoid changing dev->features directly in run-time

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt26.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

---8<------------------------------------------------------------

From 7fb031c0203f873d2794bcc4faeb59c7783a2564 Mon Sep 17 00:00:00 2001
From: Eugenia Emantayev <eugenia@mellanox.com>
Date: Wed, 17 Feb 2016 17:24:27 +0200
Subject: net/mlx4_en: Avoid changing dev->features directly in run-time

commit 925ab1aa9394bbaeac47ee5b65d3fdf0fb8135cf upstream.

It's forbidden to manually change dev->features in run-time. Currently, this is
done in the driver to make sure that GSO_UDP_TUNNEL is advertized only when
VXLAN tunnel is set. However, since the stack actually does features intersection
with hw_enc_features, we can safely revert to advertizing features early when
registering the netdevice.

Fixes: f4a1edd56120 ('net/mlx4_en: Advertize encapsulation offloads [...]')
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Or Gerlitz March 9, 2016, 5:19 a.m. UTC | #1
On 3/8/2016 2:25 PM, Luis Henriques wrote:
> This is a note to let you know that I have just added a patch titled
>
>      net/mlx4_en: Avoid changing dev->features directly in run-time

This patch is fixing upstream commit f4a1edd56120 ('net/mlx4_en: Advertize encapsulation offloads [...]') -- which was added in 3.18 -- why do you need it for 3.16.something? did you backported the offending commit there?

Or.
Luis Henriques March 9, 2016, 9:58 a.m. UTC | #2
Hi Or,

On Wed, Mar 09, 2016 at 07:19:45AM +0200, Or Gerlitz wrote:
> On 3/8/2016 2:25 PM, Luis Henriques wrote:
> >This is a note to let you know that I have just added a patch titled
> >
> >     net/mlx4_en: Avoid changing dev->features directly in run-time
> 
> This patch is fixing upstream commit f4a1edd56120 ('net/mlx4_en:
> Advertize encapsulation offloads [...]') -- which was added in 3.18
> -- why do you need it for 3.16.something? did you backported the
> offending commit there?

Thank you for your review and feedback.

Yes, commit f4a1edd56120 has been backported to the 3.16 kernel, and
has been included in release 3.16.7-ckt3.  Thus I believe it also
makes sense to backport 925ab1aa9394.

Cheers,
--
Luís

> 
> Or.
> 
>
Or Gerlitz March 9, 2016, 9:59 a.m. UTC | #3
On 3/9/2016 11:58 AM, Luis Henriques wrote:
> Yes, commit f4a1edd56120 has been backported to the 3.16 kernel, and
> has been included in release 3.16.7-ckt3.  Thus I believe it also
> makes sense to backport 925ab1aa9394.

okay, sure, please do take it.

Thanks for the clarification.

Or.
diff mbox

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index bf3878823c96..1f588195fe9f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2324,8 +2324,6 @@  out:
 	/* set offloads */
 	priv->dev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
 				      NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL;
-	priv->dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
-	priv->dev->features    |= NETIF_F_GSO_UDP_TUNNEL;
 }

 static void mlx4_en_del_vxlan_offloads(struct work_struct *work)
@@ -2336,8 +2334,6 @@  static void mlx4_en_del_vxlan_offloads(struct work_struct *work)
 	/* unset offloads */
 	priv->dev->hw_enc_features &= ~(NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
 				      NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL);
-	priv->dev->hw_features &= ~NETIF_F_GSO_UDP_TUNNEL;
-	priv->dev->features    &= ~NETIF_F_GSO_UDP_TUNNEL;

 	ret = mlx4_SET_PORT_VXLAN(priv->mdev->dev, priv->port,
 				  VXLAN_STEER_BY_OUTER_MAC, 0);
@@ -2618,6 +2614,11 @@  int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 	if (mdev->dev->caps.steering_mode != MLX4_STEERING_MODE_A0)
 		dev->priv_flags |= IFF_UNICAST_FLT;

+	if (mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) {
+		dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
+		dev->features    |= NETIF_F_GSO_UDP_TUNNEL;
+	}
+
 	mdev->pndev[port] = dev;

 	netif_carrier_off(dev);