All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net/mlx4_core: Fix kernel Oops (mem corruption) when working with more than 80 VFs
@ 2015-02-02 13:18 Amir Vadai
  2015-02-03  3:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Vadai @ 2015-02-02 13:18 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Amir Vadai, Or Gerlitz, Yevgeny Petrilin, Jack Morgenstein

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

Commit de966c592802 (net/mlx4_core: Support more than 64 VFs) was meant to
allow up to 126 VFs.  However, due to leaving MLX4_MFUNC_MAX too low, using
more than 80 VFs resulted in memory corruptions (and Oopses) when more than
80 VFs were requested. In addition, the number of slaves was left too high.

This commit fixes these issues.

Fixes: de966c592802 ("net/mlx4_core: Support more than 64 VFs")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/mlx4.h | 3 ++-
 include/linux/mlx4/device.h               | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index bdd4eea..210691c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -235,7 +235,8 @@ do {									\
 extern int mlx4_log_num_mgm_entry_size;
 extern int log_mtts_per_seg;
 
-#define MLX4_MAX_NUM_SLAVES	(MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF)
+#define MLX4_MAX_NUM_SLAVES	(min(MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF, \
+				     MLX4_MFUNC_MAX))
 #define ALL_SLAVES 0xff
 
 struct mlx4_bitmap {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 25c791e..5f3a9aa 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -97,7 +97,7 @@ enum {
 	MLX4_MAX_NUM_PF		= 16,
 	MLX4_MAX_NUM_VF		= 126,
 	MLX4_MAX_NUM_VF_P_PORT  = 64,
-	MLX4_MFUNC_MAX		= 80,
+	MLX4_MFUNC_MAX		= 128,
 	MLX4_MAX_EQ_NUM		= 1024,
 	MLX4_MFUNC_EQ_NUM	= 4,
 	MLX4_MFUNC_MAX_EQES     = 8,
-- 
1.9.3

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

* Re: [PATCH net] net/mlx4_core: Fix kernel Oops (mem corruption) when working with more than 80 VFs
  2015-02-02 13:18 [PATCH net] net/mlx4_core: Fix kernel Oops (mem corruption) when working with more than 80 VFs Amir Vadai
@ 2015-02-03  3:38 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-02-03  3:38 UTC (permalink / raw)
  To: amirv; +Cc: netdev, ogerlitz, yevgenyp, jackm

From: Amir Vadai <amirv@mellanox.com>
Date: Mon,  2 Feb 2015 15:18:42 +0200

> From: Jack Morgenstein <jackm@dev.mellanox.co.il>
> 
> Commit de966c592802 (net/mlx4_core: Support more than 64 VFs) was meant to
> allow up to 126 VFs.  However, due to leaving MLX4_MFUNC_MAX too low, using
> more than 80 VFs resulted in memory corruptions (and Oopses) when more than
> 80 VFs were requested. In addition, the number of slaves was left too high.
> 
> This commit fixes these issues.
> 
> Fixes: de966c592802 ("net/mlx4_core: Support more than 64 VFs")
> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
> Signed-off-by: Amir Vadai <amirv@mellanox.com>

Applied, thanks.

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

end of thread, other threads:[~2015-02-03  3:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 13:18 [PATCH net] net/mlx4_core: Fix kernel Oops (mem corruption) when working with more than 80 VFs Amir Vadai
2015-02-03  3:38 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.