[ofw] [PATCH] [ibbus]

Alex Naslednikov xalex at mellanox.co.il
Sun Sep 19 05:55:22 PDT 2010


Resending this patch again aligned with the latest trunk. 
The change is now also at IPoIB_NDIS6_CM.
This patch is essential for 4K MTU support

Index: hw/mlx4/kernel/bus/net/port.c
===================================================================
--- hw/mlx4/kernel/bus/net/port.c	(revision 2934)
+++ hw/mlx4/kernel/bus/net/port.c	(working copy)
@@ -355,6 +355,14 @@
 				    ETH_HLEN + ETH_FCS_LEN);
 		((__be16 *) mailbox->buf)[4] = cpu_to_be16(1 << 15);
 		((__be16 *) mailbox->buf)[6] = cpu_to_be16(1 << 15);
+	} else {
+	/* IB PORT */
+		
+		((__be32 *) mailbox->buf)[0] |= cpu_to_be32((1 << 22) | (1 << 21) | (5 << 12) | (2 << 4));
+		/* Set mmc bit no. 22 to allow MAX_MTU_SIZE change */
+		/* Set mvc bit no. 21 to allow vl_cap change /*
+		/* Always set MAX_MTU_SIZE == 4K for MLX4 - bits 12:15 */
+		/* Change vl_cap to be maximum 4 - bits 5:7 */
 	}
 	err = mlx4_cmd(dev, mailbox->dma.da, port, is_eth, MLX4_CMD_SET_PORT,
 		       MLX4_CMD_TIME_CLASS_B);
Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
===================================================================
--- ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp	(revision 2934)
+++ ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp	(working copy)
@@ -1038,7 +1038,10 @@
 	gat.MediaConnectState = MediaConnectStateConnected; //TODO NDIS60 Check the current state
 	gat.MediaDuplexState = MediaDuplexStateFull;
 
-	gat.MtuSize = DEFAULT_PAYLOAD_MTU;
+	//TODO add support for CM MTU
+	gat.MtuSize = p_adapter->params.payload_mtu;
+	// TODO Can we set gat.MtuSize = p_adapter->params.payload_mtu + sizeof (ipoib_hdr_t) 
+	// That is because we replace ETH header by IPoIB header and do not allocate additional place
 	gat.LookaheadSize = MAX_XFER_BLOCK_SIZE;
 	gat.MacOptions = NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA | 
 					 NDIS_MAC_OPTION_TRANSFERS_NOT_PEND |

From: Alex Naslednikov 
Sent: Thursday, December 17, 2009 5:42 PM
To: ofw at lists.openfabrics.org
Subject: [ofw] [PATCH] [ibbus]

This patch enables 4K MTU support for CX and CX-II cards with FW ver. 2.7.000 and upper
Signed of by: Alexander Naslednikov (xalex at mellanox.co.il)
===================================================================
--- D:/windows/MLNX_WinOF_trunk/hw/mlx4/kernel/bus/net/port.c (revision 5259)
+++ D:/windows/MLNX_WinOF_trunk/hw/mlx4/kernel/bus/net/port.c (revision 5260)
@@ -355,6 +355,14 @@
         ETH_HLEN + ETH_FCS_LEN);
   ((__be16 *) mailbox->buf)[4] = cpu_to_be16(1 << 15);
   ((__be16 *) mailbox->buf)[6] = cpu_to_be16(1 << 15);
+ } else {
+ /* IB PORT */
+  
+  ((__be32 *) mailbox->buf)[0] |= cpu_to_be32((1 << 22) | (1 << 21) | (5 << 12) | (2 << 4));
+  /* Set mmc bit no. 22 to allow MAX_MTU_SIZE change */
+  /* Set mvc bit no. 21 to allow vl_cap change /*
+  /* Always set MAX_MTU_SIZE == 4K for MLX4 - bits 12:15 */
+  /* Change vl_cap to be maximum 4 - bits 5:7 */
  }
  err = mlx4_cmd(dev, mailbox->dma.da, port, is_eth, MLX4_CMD_SET_PORT,
          MLX4_CMD_TIME_CLASS_B);



More information about the ofw mailing list