From f04cf0bfff1e6e0617fa540a343fb0db18bc9be7 Mon Sep 17 00:00:00 2001 From: Alex Naslednikov Date: Tue, 21 Sep 2010 15:19:38 +0000 Subject: [PATCH] [IPoIB_NDIS6_CM] [HW] 4K MTU support git-svn-id: svn://openib.tc.cornell.edu/gen1@2941 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/hw/mlx4/kernel/bus/net/port.c | 20 +++++++++++++------ .../ipoib_NDIS6_CM/kernel/ipoib_driver.cpp | 5 ++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/trunk/hw/mlx4/kernel/bus/net/port.c b/trunk/hw/mlx4/kernel/bus/net/port.c index 3bc3b800..65e47d4e 100644 --- a/trunk/hw/mlx4/kernel/bus/net/port.c +++ b/trunk/hw/mlx4/kernel/bus/net/port.c @@ -341,12 +341,12 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, memset(mailbox->buf, 0, 256); if (dev->flags & MLX4_FLAG_OLD_PORT_CMDS) { - *(u8 *) mailbox->buf = (u8)(!!reset_qkey_viols << 6); - ((__be32 *) mailbox->buf)[2] = cpu_to_be32(cap_mask); - } else { - ((u8 *) mailbox->buf)[3] = (u8)!!reset_qkey_viols; - ((__be32 *) mailbox->buf)[1] = cpu_to_be32(cap_mask); - } + *(u8 *) mailbox->buf = (u8)(!!reset_qkey_viols << 6); + ((__be32 *) mailbox->buf)[2] = cpu_to_be32(cap_mask); + } else { + ((u8 *) mailbox->buf)[3] = (u8)!!reset_qkey_viols; + ((__be32 *) mailbox->buf)[1] = cpu_to_be32(cap_mask); + } if (is_eth) { ((u8 *) mailbox->buf)[3] = 7; @@ -355,6 +355,14 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, 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); diff --git a/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp b/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp index 1d4fc184..c5031d52 100644 --- a/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp +++ b/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp @@ -1038,7 +1038,10 @@ SetGenericAttributes( 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 | -- 2.46.0