[IPOIB] payload MTU is configured from the registry values: 60-2044 bytes
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 20 Nov 2006 13:11:54 +0000 (13:11 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 20 Nov 2006 13:11:54 +0000 (13:11 +0000)
Singed-off-by:Anatoly Lisenko (anatolyl@voltaire.com)

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@545 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_adapter.h
ulp/ipoib/kernel/ipoib_driver.c
ulp/ipoib/kernel/ipoib_driver.h
ulp/ipoib/kernel/ipoib_port.c
ulp/ipoib/kernel/netipoib.inf

index 074f1b5..8497fe7 100644 (file)
@@ -70,6 +70,8 @@ typedef struct _ipoib_params
        uint32_t        sa_timeout;\r
        uint32_t        sa_retry_cnt;\r
        uint32_t        recv_pool_ratio;\r
+       uint32_t        payload_mtu;\r
+       uint32_t        xfer_block_size;\r
        mac_addr_t      conf_mac;\r
 \r
 }      ipoib_params_t;\r
index d791243..c17d315 100644 (file)
@@ -525,6 +525,18 @@ ipoib_get_adapter_params(
        }\r
        p_adapter->params.recv_pool_ratio = p_param->ParameterData.IntegerData;\r
 \r
+       /* required: MTU size. */\r
+       RtlInitUnicodeString( &keyword, L"PayloadMtu" );\r
+       NdisReadConfiguration(\r
+               &status, &p_param, h_config, &keyword, NdisParameterInteger );\r
+       if( status != NDIS_STATUS_SUCCESS )\r
+       {\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("PayloadMtu parameter missing. Use the default.\n") );\r
+               return status;\r
+       }\r
+       p_adapter->params.payload_mtu = p_param->ParameterData.IntegerData;\r
+       p_adapter->params.xfer_block_size = (sizeof(eth_hdr_t) + p_adapter->params.payload_mtu);\r
        NdisReadNetworkAddress( &status, &mac, &len, h_config );\r
 \r
        ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr, p_adapter->mac.addr );\r
@@ -705,7 +717,7 @@ ipoib_initialize(
 \r
 #if IPOIB_USE_DMA\r
        status =\r
-               NdisMInitializeScatterGatherDma( h_adapter, TRUE, XFER_BLOCK_SIZE );\r
+               NdisMInitializeScatterGatherDma( h_adapter, TRUE, p_adapter->params.xfer_block_size );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
                ipoib_destroy_adapter( p_adapter );\r
@@ -889,7 +901,7 @@ ipoib_query_info(
        case OID_GEN_MAXIMUM_FRAME_SIZE:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MAXIMUM_FRAME_SIZE\n", port_num) );\r
-               info = PAYLOAD_MTU;\r
+               info = p_adapter->params.payload_mtu;\r
                break;\r
 \r
        case OID_GEN_LINK_SPEED:\r
@@ -927,14 +939,14 @@ ipoib_query_info(
        case OID_GEN_TRANSMIT_BUFFER_SPACE:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_TRANSMIT_BUFFER_SPACE\n", port_num) );\r
-               info = p_adapter->params.sq_depth * XFER_BLOCK_SIZE;\r
+               info = p_adapter->params.sq_depth * p_adapter->params.xfer_block_size;\r
                break;\r
 \r
        case OID_GEN_RECEIVE_BUFFER_SPACE:\r
                IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_TRANSMIT_BUFFER_SPACE "\r
                        "or OID_GEN_RECEIVE_BUFFER_SPACE\n", port_num) );\r
-               info = p_adapter->params.rq_depth * XFER_BLOCK_SIZE;\r
+               info = p_adapter->params.rq_depth * p_adapter->params.xfer_block_size;\r
                break;\r
 \r
        case OID_GEN_MAXIMUM_LOOKAHEAD:\r
@@ -948,7 +960,7 @@ ipoib_query_info(
                        "OID_GEN_TRANSMIT_BLOCK_SIZE or "\r
                        "OID_GEN_RECEIVE_BLOCK_SIZE or "\r
                        "OID_GEN_MAXIMUM_TOTAL_SIZE\n", port_num) );\r
-               info = XFER_BLOCK_SIZE;\r
+               info = p_adapter->params.xfer_block_size;\r
                break;\r
 \r
        case OID_GEN_VENDOR_ID:\r
index ee4f588..f27c388 100644 (file)
  * Header length as defined by IPoIB spec:\r
  * http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-04.txt\r
  */\r
-#define PAYLOAD_MTU            (IB_MTU - sizeof(ipoib_hdr_t))\r
\r
+#define MAX_PAYLOAD_MTU                (IB_MTU - sizeof(ipoib_hdr_t))\r
+\r
 /*\r
  * Only the protocol type is sent as part of the UD payload\r
  * since the rest of the Ethernet header is encapsulated in the\r
  * various IB headers.  We report out buffer space as if we\r
  * transmit the ethernet headers.\r
  */\r
-#define XFER_BLOCK_SIZE                (sizeof(eth_hdr_t) + PAYLOAD_MTU)\r
+#define MAX_XFER_BLOCK_SIZE            (sizeof(eth_hdr_t) + MAX_PAYLOAD_MTU)\r
 \r
 \r
 typedef struct _ipoib_globals\r
index cb85fba..36ef586 100644 (file)
@@ -955,7 +955,7 @@ __buf_mgr_construct(
        p_port->buf_mgr.h_buffer_pool = NULL;\r
 \r
        ExInitializeNPagedLookasideList( &p_port->buf_mgr.send_buf_list,\r
-               NULL, NULL, 0, XFER_BLOCK_SIZE, 'bipi', 0 );\r
+               NULL, NULL, 0, MAX_XFER_BLOCK_SIZE, 'bipi', 0 );\r
 \r
        p_port->buf_mgr.h_send_pkt_pool = NULL;\r
        p_port->buf_mgr.h_send_buf_pool = NULL;\r
@@ -2715,7 +2715,7 @@ __send_copy(
        }\r
 \r
        NdisAllocateBuffer( &status, &p_buf, p_port->buf_mgr.h_send_buf_pool,\r
-               p_desc->p_buf, XFER_BLOCK_SIZE );\r
+               p_desc->p_buf, p_port->p_adapter->params.xfer_block_size );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
                NdisFreePacket( p_packet );\r
@@ -2798,7 +2798,7 @@ __send_gen(
        }\r
 \r
        CL_ASSERT( tot_len > sizeof(eth_hdr_t) );\r
-       CL_ASSERT( tot_len <= XFER_BLOCK_SIZE );\r
+       CL_ASSERT( tot_len <= p_port->p_adapter->params.xfer_block_size );\r
        /*\r
         * Assume that the ethernet header is always fully contained\r
         * in the first page of the first MDL.  This makes for much\r
@@ -2818,7 +2818,7 @@ __send_gen(
                        CL_ASSERT( buf_len >= sizeof(eth_hdr_t) );\r
                        /* Skip the ethernet header. */\r
                        buf_len -= sizeof(eth_hdr_t);\r
-                       CL_ASSERT( buf_len <= PAYLOAD_MTU );\r
+                       CL_ASSERT( buf_len <= p_port->p_adapter->params.payload_mtu );\r
                        if( buf_len )\r
                        {\r
                                /* The ethernet header is a subset of this MDL. */\r
index 546a01b..a2b9136 100644 (file)
@@ -118,6 +118,12 @@ HKR, Ndi\Params\RecvRatio,         Optional,       0, "0"
 HKR, Ndi\Params\RecvRatio,             Min,            0, "1"\r
 HKR, Ndi\Params\RecvRatio,             Max,            0, "10"\r
 \r
+HKR, Ndi\Params\PayloadMtu,            ParamDesc,      0, "Payload Mtu size"\r
+HKR, Ndi\Params\PayloadMtu,            Type,           0, "dword"\r
+HKR, Ndi\Params\PayloadMtu,            Default,        0, "2044"\r
+HKR, Ndi\Params\PayloadMtu,            Min,            0, "60"\r
+HKR, Ndi\Params\PayloadMtu,            Max,            0, "2044"\r
+\r
 [IpoibService]\r
 DisplayName     = %IpoibServiceDispName%\r
 ServiceType     = 1 ;%SERVICE_KERNEL_DRIVER%\r