diff mbox

upstream mlx4/ib/4K mtu support

Message ID Pine.LNX.4.64.1001111410240.28822@zuben.voltaire.com (mailing list archive)
State RFC
Headers show

Commit Message

Or Gerlitz Jan. 11, 2010, 12:13 p.m. UTC
None
diff mbox

Patch

Index: ofed_kernel-fixes/drivers/net/mlx4/port.c
===================================================================
--- ofed_kernel-fixes.orig/drivers/net/mlx4/port.c	2009-11-09 02:20:06.000000000 +0200
+++ ofed_kernel-fixes/drivers/net/mlx4/port.c	2009-11-09 02:21:46.000000000 +0200
@@ -37,6 +37,10 @@ 

 #include "mlx4.h"

+int mlx4_ib_set_4k_mtu = 0;
+module_param_named(set_4k_mtu, mlx4_ib_set_4k_mtu, int, 0444);
+MODULE_PARM_DESC(set_4k_mtu, "attempt to set 4K MTU to all ConnectX ports");
+
 #define MLX4_MAC_VALID		(1ull << 63)
 #define MLX4_MAC_MASK		0xffffffffffffULL

@@ -308,6 +312,9 @@ 

 	memset(mailbox->buf, 0, 256);

+	if (mlx4_ib_set_4k_mtu)
+		((__be32 *) mailbox->buf)[0] |= cpu_to_be32((1 << 22) | (1 << 21) | (5 << 12) | (2 << 4));
+
 	((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port];
 	err = mlx4_cmd(dev, mailbox->dma, port, 0, MLX4_CMD_SET_PORT,
 		       MLX4_CMD_TIME_CLASS_B);