From: aestrin Date: Thu, 16 Oct 2008 22:34:18 +0000 (+0000) Subject: [ipoib] cm X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ee9aee27ec276ab92933b57581fc5c4f76ca7c02;p=~shefty%2Frdma-win.git [ipoib] cm -seem max send sges wasn't large enough and was the reason why large mtu sends could fail. Set to default max. - on recv buffer destructor - validate pool_item and context. git-svn-id: svn://openib.tc.cornell.edu/gen1@1662 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/ipoib_cm/kernel/ipoib_driver.c b/branches/ipoib_cm/kernel/ipoib_driver.c index 0052b029..1861ed33 100644 --- a/branches/ipoib_cm/kernel/ipoib_driver.c +++ b/branches/ipoib_cm/kernel/ipoib_driver.c @@ -597,7 +597,7 @@ ipoib_get_adapter_params( p_adapter->params.rq_low_watermark = p_adapter->params.rq_depth / p_adapter->params.rq_low_watermark; - /* disable CM if LSO active because LSO uses UD transport only */ + /* disable CM if LSO is active */ if( p_adapter->params.cm_enabled ) { p_adapter->params.cm_enabled = !p_adapter->params.lso; @@ -988,8 +988,11 @@ ipoib_query_info( case OID_GEN_MAXIMUM_FRAME_SIZE: IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID, ("Port %d received query for OID_GEN_MAXIMUM_FRAME_SIZE\n", port_num) ); + if( p_adapter->params.cm_enabled ) + info = p_adapter->params.cm_payload_mtu; + else info = p_adapter->params.payload_mtu; - break; + break; case OID_GEN_LINK_SPEED: IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID, diff --git a/branches/ipoib_cm/kernel/ipoib_driver.h b/branches/ipoib_cm/kernel/ipoib_driver.h index 0660f593..aa611f95 100644 --- a/branches/ipoib_cm/kernel/ipoib_driver.h +++ b/branches/ipoib_cm/kernel/ipoib_driver.h @@ -66,14 +66,11 @@ #define DATA_OFFSET (sizeof(eth_hdr_t) - sizeof(ipoib_hdr_t)) //#define IPOIB_CM_FLAG_RC (0x01) // RC flag -//#define IPOIB_CM_FLAG_SVCID (0x01) // IETF bit +//#define IPOIB_CM_FLAG_SVCID (0x01) // IETF bit #define IPOIB_CM_FLAG_RC (0x80) //OFED set RC flag this way #define IPOIB_CM_FLAG_SVCID (0x10) // OFED set IETF bit this way ( open OFED PR 1121 ) -/* Max send data segment list size. Segments are PAGE_SIZE each */ -/* + 2 to roundup( since fisrt and last segments could be partial pages ) - + 1 reserved for ipoib header, add another 2 for IP and TCP headers */ -#define MAX_SEND_SGE (( MAX_CM_PAYLOAD_MTU >> PAGE_SHIFT ) + 5) +#define MAX_SEND_SGE (30) /* Amount of physical memory to register. */ #define MEM_REG_SIZE 0xFFFFFFFFFFFFFFFF diff --git a/branches/ipoib_cm/kernel/ipoib_endpoint.c b/branches/ipoib_cm/kernel/ipoib_endpoint.c index ac0ff411..f572f660 100644 --- a/branches/ipoib_cm/kernel/ipoib_endpoint.c +++ b/branches/ipoib_cm/kernel/ipoib_endpoint.c @@ -789,7 +789,9 @@ __cm_recv_desc_dtor( ipoib_cm_desc_t *p_desc; ipoib_port_t* p_port; - UNUSED_PARAM( context ); + if( p_pool_item == NULL || context == NULL ) + return; + p_port = (ipoib_port_t*)context; p_desc = PARENT_STRUCT( p_pool_item, ipoib_cm_desc_t, item ); diff --git a/branches/ipoib_cm/kernel/ipoib_port.c b/branches/ipoib_cm/kernel/ipoib_port.c index 5b405aa3..f639f4c6 100644 --- a/branches/ipoib_cm/kernel/ipoib_port.c +++ b/branches/ipoib_cm/kernel/ipoib_port.c @@ -985,7 +985,7 @@ __ib_mgr_init( IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("ipoib_port_srq_init failed %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); - // disable further CM initialization + /* disable further CM initialization */ p_port->p_adapter->params.cm_enabled = FALSE; NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, @@ -1005,6 +1005,12 @@ __ib_mgr_init( NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, EVENT_IPOIB_CONNECTED_MODE_ERR, 1, 0xbadc0de2 ); } + else + { + /* now we can adjust csum capabilities */ + p_port->p_adapter->params.send_chksum_offload = CSUM_DISABLED; + p_port->p_adapter->params.recv_chksum_offload = CSUM_BYPASS; + } } IPOIB_EXIT( IPOIB_DBG_INIT ); return IB_SUCCESS; @@ -3278,7 +3284,7 @@ __send_gen( } /* Remember that one of the DS entries is reserved for the IPoIB header. */ - if( ( p_sgl->NumberOfElements >= MAX_SEND_SGE || + if( ( p_sgl->NumberOfElements > MAX_SEND_SGE || p_sgl->Elements[0].Length < sizeof(eth_hdr_t)) ) { @@ -3998,8 +4004,8 @@ __send_mgr_filter_arp( if( p_port->p_adapter->params.cm_enabled ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, - (" %s SEND to ENDPT[%p] State: %d flag: %#x, QPN: %#x MAC %02x:%02x:%02x:%02x:%02x:%02x\n", - (( p_arp->op == ARP_OP_REQ )? "ARP REQUEST" : "ARP REPLY" ), + (" ARP %s SEND to ENDPT[%p] State: %d flag: %#x, QPN: %#x MAC %02x:%02x:%02x:%02x:%02x:%02x\n", + (( p_arp->op == ARP_OP_REQ )? "REQUEST" : "REPLY" ), p_desc->p_endpt, endpt_cm_get_state( p_desc->p_endpt ), p_desc->p_endpt->cm_flag,