netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
@ 2014-11-18 15:51 Or Gerlitz
  2014-11-19 20:11 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Or Gerlitz @ 2014-11-18 15:51 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Florian Westphal, Amir Vadai, Saeed Mahameed, Or Gerlitz

This is currently missing, which results in a crash when one attempts
to set VXLAN tunnel over the mlx4_en when acting as PF.

	[ 2408.785472] BUG: unable to handle kernel NULL pointer dereference at (null)
	[...]
	[ 2408.994104] Call Trace:
	[ 2408.996584]  [<ffffffffa021f7f5>] ? vxlan_get_rx_port+0xd6/0x103 [vxlan]
	[ 2409.003316]  [<ffffffffa021f71f>] ? vxlan_lowerdev_event+0xf2/0xf2 [vxlan]
	[ 2409.010225]  [<ffffffffa0630358>] mlx4_en_start_port+0x862/0x96a [mlx4_en]
	[ 2409.017132]  [<ffffffffa063070f>] mlx4_en_open+0x17f/0x1b8 [mlx4_en]

While here, make sure to invoke vxlan_get_rx_port() only when VXLAN
offloads are actually enabled and not when they are only supported.

Reported-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index c5fcc56..4d69e38 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1693,7 +1693,7 @@ int mlx4_en_start_port(struct net_device *dev)
 	mlx4_set_stats_bitmap(mdev->dev, &priv->stats_bitmap);
 
 #ifdef CONFIG_MLX4_EN_VXLAN
-	if (priv->mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS)
+	if (priv->mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
 		vxlan_get_rx_port(dev);
 #endif
 	priv->port_up = true;
@@ -2422,6 +2422,11 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
 	.ndo_rx_flow_steer	= mlx4_en_filter_rfs,
 #endif
 	.ndo_get_phys_port_id	= mlx4_en_get_phys_port_id,
+#ifdef CONFIG_MLX4_EN_VXLAN
+	.ndo_add_vxlan_port	= mlx4_en_add_vxlan_port,
+	.ndo_del_vxlan_port	= mlx4_en_del_vxlan_port,
+	.ndo_gso_check		= mlx4_en_gso_check,
+#endif
 };
 
 int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
  2014-11-18 15:51 [PATCH net] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too Or Gerlitz
@ 2014-11-19 20:11 ` David Miller
  2014-11-20  5:16   ` Or Gerlitz
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2014-11-19 20:11 UTC (permalink / raw)
  To: ogerlitz; +Cc: netdev, fw, amirv, saeedm

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Tue, 18 Nov 2014 17:51:27 +0200

> This is currently missing, which results in a crash when one attempts
> to set VXLAN tunnel over the mlx4_en when acting as PF.
> 
> 	[ 2408.785472] BUG: unable to handle kernel NULL pointer dereference at (null)
> 	[...]
> 	[ 2408.994104] Call Trace:
> 	[ 2408.996584]  [<ffffffffa021f7f5>] ? vxlan_get_rx_port+0xd6/0x103 [vxlan]
> 	[ 2409.003316]  [<ffffffffa021f71f>] ? vxlan_lowerdev_event+0xf2/0xf2 [vxlan]
> 	[ 2409.010225]  [<ffffffffa0630358>] mlx4_en_start_port+0x862/0x96a [mlx4_en]
> 	[ 2409.017132]  [<ffffffffa063070f>] mlx4_en_open+0x17f/0x1b8 [mlx4_en]
> 
> While here, make sure to invoke vxlan_get_rx_port() only when VXLAN
> offloads are actually enabled and not when they are only supported.
> 
> Reported-by: Ido Shamay <idos@mellanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>

Applied, -stable material?  If so for what releases?

In the future, if you add an appropriated Fixes: tag I can figure most
of this out without asking you.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
  2014-11-19 20:11 ` David Miller
@ 2014-11-20  5:16   ` Or Gerlitz
  2014-11-21 19:55     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Or Gerlitz @ 2014-11-20  5:16 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, fw, amirv, saeedm

On 11/19/2014 10:11 PM, David Miller wrote:
> Applied, -stable material? If so for what releases? In the future, if 
> you add an appropriated Fixes: tag I can figure most of this out 
> without asking you. Thanks. 


Yes, please! let the below commits two swim for a while in 3.18-rc and 
later push
them to -stable >= 3.15, got it re the fixes: tag, thanks for the heads-up.

9737c6a net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
f4a1edd net/mlx4_en: Advertize encapsulation offloads features only when 
VXLAN tunnel is set

Or.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
  2014-11-20  5:16   ` Or Gerlitz
@ 2014-11-21 19:55     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-11-21 19:55 UTC (permalink / raw)
  To: ogerlitz; +Cc: netdev, fw, amirv, saeedm

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Thu, 20 Nov 2014 07:16:03 +0200

> On 11/19/2014 10:11 PM, David Miller wrote:
>> Applied, -stable material? If so for what releases? In the future, if
>> you add an appropriated Fixes: tag I can figure most of this out
>> without asking you. Thanks.
> 
> 
> Yes, please! let the below commits two swim for a while in 3.18-rc and
> later push
> them to -stable >= 3.15, got it re the fixes: tag, thanks for the
> heads-up.
> 
> 9737c6a net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
> f4a1edd net/mlx4_en: Advertize encapsulation offloads features only
> when VXLAN tunnel is set

Ok, queued up for -stable.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-21 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 15:51 [PATCH net] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too Or Gerlitz
2014-11-19 20:11 ` David Miller
2014-11-20  5:16   ` Or Gerlitz
2014-11-21 19:55     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).