TARGETPATH=..\..\..\bin\kernel\obj$(BUILD_ALT_DIR)\r
TARGETTYPE=DRIVER\r
\r
+!if $(_NT_TOOLS_VERSION) != 0x700\r
+# WDK build only - transform .inx --> .inf adding date & version stamp.\r
+# see .\makefile.inc\r
+INF_NAME=netipoib\r
+INF_TARGET=..\..\..\bin\kernel\$(O)\$(INF_NAME).inf\r
+NTTARGETFILES=$(INF_TARGET)\r
+!endif\r
\r
!if $(FREEBUILD)\r
ENABLE_EVENT_TRACING=1\r
<hash>ipoib.sys=ipoib.sys\r
<hash>ibwsd.dll=ibwsd.dll\r
<hash>ibwsd32.dll=ibwsd32.dll\r
-\r
-\r
+<hash>ibndprov.dll=ibndprov.dll\r
+<hash>ibndprov32.dll=ibndprov32.dll\r
+<hash>ndinstall.exe=ndinstall.exe\r
}\r
\r
\r
+static ib_api_status_t\r
+ipoib_query_pkey_index(ipoib_adapter_t *p_adapter)\r
+{\r
+ ib_api_status_t status;\r
+ ib_ca_attr_t *ca_attr;\r
+ uint32_t ca_size;\r
+ uint16_t index = 0;\r
+\r
+ /* Query the CA for Pkey table */\r
+ status = p_adapter->p_ifc->query_ca(p_adapter->p_port->ib_mgr.h_ca, NULL, &ca_size);\r
+ if(status != IB_INSUFFICIENT_MEMORY)\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("ib_query_ca failed\n"));\r
+ return status;\r
+ }\r
+\r
+ ca_attr = (ib_ca_attr_t*)cl_zalloc(ca_size);\r
+ if (!ca_attr)\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("cl_zalloc can't allocate %d\n",ca_size));\r
+ return IB_INSUFFICIENT_MEMORY;\r
+ }\r
+\r
+ status = p_adapter->p_ifc->query_ca(p_adapter->p_port->ib_mgr.h_ca, ca_attr,&ca_size); \r
+ if( status != IB_SUCCESS )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("ib_query_ca returned %s\n", \r
+ p_adapter->p_ifc->get_err_str( status )) );\r
+ goto pkey_end;\r
+ }\r
+\r
+ CL_ASSERT(ca_attr->p_port_attr->p_pkey_table[0] == IB_DEFAULT_PKEY);\r
+ for(index = 0; index < ca_attr->p_port_attr->num_pkeys; index++)\r
+ {\r
+ if(cl_hton16(p_adapter->guids.port_guid.pkey) == ca_attr->p_port_attr->p_pkey_table[index])\r
+ break;\r
+ }\r
+ if(index >= ca_attr->p_port_attr->num_pkeys)\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Pkey table is invalid, index not found\n"));\r
+ NdisWriteErrorLogEntry( p_adapter->h_adapter,\r
+ EVENT_IPOIB_PARTITION_ERR, 1, p_adapter->guids.port_guid.pkey );\r
+ p_adapter->p_port->pkey_index = PKEY_INVALID_INDEX;\r
+ goto pkey_end;\r
+ }\r
+\r
+ p_adapter->p_port->pkey_index = index;\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_IB,\r
+ ("for PKEY = 0x%04X got index = %d\n",p_adapter->guids.port_guid.pkey,index));\r
+\r
+pkey_end:\r
+ if(ca_attr)\r
+ cl_free(ca_attr);\r
+ return status;\r
+}\r
+\r
static ib_api_status_t\r
__ipoib_pnp_cb(\r
IN ib_pnp_rec_t *p_pnp_rec )\r
{\r
- ib_api_status_t status;\r
ipoib_adapter_t *p_adapter;\r
ipoib_port_t *p_port;\r
ib_pnp_event_t old_state;\r
ib_pnp_port_rec_t *p_port_rec;\r
+ ib_api_status_t status = IB_SUCCESS;\r
\r
IPOIB_ENTER( IPOIB_DBG_PNP );\r
\r
("IPOIB: Received unhandled PnP event 0x%x (%s)\n",\r
p_pnp_rec->pnp_event, ib_get_pnp_event_str( p_pnp_rec->pnp_event )) );\r
/* Fall through. */\r
- case IB_PNP_PKEY_CHANGE:\r
- case IB_PNP_SM_CHANGE:\r
- case IB_PNP_GID_CHANGE:\r
- case IB_PNP_LID_CHANGE:\r
+\r
status = IB_SUCCESS;\r
\r
- /* We ignore this event if the link is not active. */\r
+ /* We ignore events below if the link is not active. */\r
if( p_port_rec->p_port_attr->link_state != IB_LINK_ACTIVE )\r
- break;\r
+ break;\r
+\r
+ case IB_PNP_PKEY_CHANGE:\r
+ if(p_pnp_rec->pnp_event == IB_PNP_PKEY_CHANGE && \r
+ p_adapter->guids.port_guid.pkey != IB_DEFAULT_PKEY)\r
+ {\r
+ status = ipoib_query_pkey_index(p_adapter);\r
+ if(status != IB_SUCCESS)\r
+ break;\r
+ }\r
+\r
+ case IB_PNP_SM_CHANGE:\r
+ case IB_PNP_GID_CHANGE:\r
+ case IB_PNP_LID_CHANGE:\r
\r
cl_obj_lock( &p_adapter->obj );\r
old_state = p_adapter->state;\r
\r
if( j != p_adapter->mcast_array_size )\r
continue;\r
-\r
- ipoib_port_join_mcast( p_port, p_mac_array[i] ,IB_MC_REC_STATE_FULL_MEMBER);\r
+ if ( ( p_mac_array[i].addr[0] == 1 && p_mac_array[i].addr[1] == 0 && p_mac_array[i].addr[2] == 0x5e &&\r
+ p_mac_array[i].addr[3] == 0 && p_mac_array[i].addr[4] == 0 && p_mac_array[i].addr[5] == 1 ) ||\r
+ !( p_mac_array[i].addr[0] == 1 && p_mac_array[i].addr[1] == 0 && p_mac_array[i].addr[2] == 0x5e )\r
+ )\r
+ {\r
+ ipoib_port_join_mcast( p_port, p_mac_array[i], IB_MC_REC_STATE_FULL_MEMBER );\r
+ }\r
}\r
}\r
\r
break;\r
\r
default:\r
+ if (p_adapter->guids.port_guid.pkey != IB_DEFAULT_PKEY)\r
+ ipoib_query_pkey_index(p_adapter);\r
+\r
/* Join all programmed multicast groups. */\r
for( i = 0; i < p_adapter->mcast_array_size; i++ )\r
{\r
uint32_t payload_mtu;\r
uint32_t xfer_block_size;\r
mac_addr_t conf_mac;\r
+ uint32_t mc_leave_rescan;\r
boolean_t cm_enabled;\r
uint32_t cm_payload_mtu;\r
uint32_t cm_xfer_block_size;\r
conn_req.p_req_pdata = (uint8_t *)&p_endpt->conn.private_data;\r
conn_req.req_length = sizeof( cm_private_data_t );\r
conn_req.svc_id = p_endpt->conn.service_id;\r
- conn_req.p_primary_path = (ib_path_rec_t* __ptr64)&p_endpt->conn.path_rec;\r
+ conn_req.p_primary_path = (ib_path_rec_t*)&p_endpt->conn.path_rec;\r
\r
conn_req.retry_cnt = 3;\r
conn_req.rnr_nak_timeout = 22; /* 20 ms */\r
\r
CL_ASSERT( p_cm_req );\r
\r
- p_port = (ipoib_port_t* __ptr64) p_cm_req->context;\r
+ p_port = (ipoib_port_t*) p_cm_req->context;\r
p_endpt = ipoib_endpt_get_by_gid( p_port, &p_cm_req->primary_path.dgid );\r
\r
if( !p_endpt )\r
return;\r
\r
/*copy private data and parse */\r
- private_data = (*(cm_private_data_t * __ptr64)p_cm_req->p_req_pdata);\r
+ private_data = (*(cm_private_data_t *)p_cm_req->p_req_pdata);\r
\r
if( private_data.ud_qpn != p_endpt->qpn )\r
{\r
\r
cl_memclr( &cm_reply, sizeof( ib_cm_rep_t ) );\r
\r
- private_data.recv_mtu = ((cm_private_data_t * __ptr64)p_cm_req->p_req_pdata)->recv_mtu;\r
- private_data.ud_qpn = ((cm_private_data_t * __ptr64)p_cm_req->p_req_pdata)->ud_qpn;\r
+ private_data.recv_mtu = ((cm_private_data_t *)p_cm_req->p_req_pdata)->recv_mtu;\r
+ private_data.ud_qpn = ((cm_private_data_t *)p_cm_req->p_req_pdata)->ud_qpn;\r
\r
cm_reply.p_rep_pdata = (uint8_t*)&private_data;\r
cm_reply.rep_length = sizeof( cm_private_data_t );\r
IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
CL_ASSERT( p_cm_rep );\r
\r
- p_endpt = (ipoib_endpt_t* __ptr64) p_cm_rep->qp_context;\r
+ p_endpt = (ipoib_endpt_t* ) p_cm_rep->qp_context;\r
\r
if( ! p_endpt )\r
return;\r
\r
CL_ASSERT( p_rej_rec );\r
\r
- p_endpt = (ipoib_endpt_t* __ptr64)p_rej_rec->qp_context;\r
+ p_endpt = (ipoib_endpt_t* )p_rej_rec->qp_context;\r
p_port = ipoib_endpt_parent( p_endpt );\r
\r
CL_ASSERT( p_endpt->conn.h_qp == p_rej_rec->h_qp );\r
\r
CL_ASSERT( p_dreq_rec );\r
\r
- p_endpt = (ipoib_endpt_t * __ptr64)p_dreq_rec->qp_context;\r
+ p_endpt = (ipoib_endpt_t *)p_dreq_rec->qp_context;\r
p_port = ipoib_endpt_parent( p_endpt );\r
\r
cm_state = endpt_cm_set_state( p_endpt, IPOIB_CM_DREP_SENT );\r
cm_rej.rej_status = IB_REJ_USER_DEFINED;\r
cm_rej.ari_length = sizeof( uint16_t );\r
ari_info = rej_status;\r
- cm_rej.p_ari = (ib_ari_t* __ptr64)&ari_info;\r
+ cm_rej.p_ari = (ib_ari_t *)&ari_info;\r
\r
ib_status = p_port->p_adapter->p_ifc->cm_rej( h_cm_handle, &cm_rej );\r
if( ib_status != IB_SUCCESS )\r
__endpt_async_event_cb(\r
IN ib_async_event_rec_t *p_event_rec )\r
{\r
- ipoib_endpt_t* p_endpt = (ipoib_endpt_t* __ptr64)p_event_rec->context;\r
+ ipoib_endpt_t* p_endpt = (ipoib_endpt_t *)p_event_rec->context;\r
\r
IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
("CM ENDPT [%p] ASYNC EVENT CODE ARRIVED %d(%#x)\n",\r
}\r
\r
IPOIB_EXIT( IPOIB_DBG_ENDPT );\r
-}
\ No newline at end of file
+}\r
// assignment of _level_ is need to to overcome warning C4127\r
#define IPOIB_PRINT(_level_,_flag_,_msg_) \\r
{ \\r
+ __pragma(warning(suppress:6326)) \\r
if( g_ipoib_dbg_level >= (_level_) ) \\r
CL_TRACE( _flag_, g_ipoib_dbg_flags, _msg_ ); \\r
}\r
\r
#define IPOIB_PRINT_EXIT(_level_,_flag_,_msg_) \\r
{ \\r
+ __pragma(warning(suppress:6326)) \\r
if( g_ipoib_dbg_level >= (_level_) ) \\r
CL_TRACE( _flag_, g_ipoib_dbg_flags, _msg_ );\\r
IPOIB_EXIT(_flag_);\\r
\r
#define IPOIB_ENTER(_flag_) \\r
{ \\r
+ __pragma(warning(suppress:6326)) \\r
if( g_ipoib_dbg_level >= TRACE_LEVEL_VERBOSE ) \\r
CL_ENTER( _flag_, g_ipoib_dbg_flags ); \\r
}\r
\r
#define IPOIB_EXIT(_flag_)\\r
{ \\r
+ __pragma(warning(suppress:6326)) \\r
if( g_ipoib_dbg_level >= TRACE_LEVEL_VERBOSE ) \\r
CL_EXIT( _flag_, g_ipoib_dbg_flags ); \\r
}\r
\r
#define IPOIB_TRACE_BYTES( lvl, ptr, len ) \\r
{ \\r
+ __pragma(warning(suppress:6326)) \\r
if( g_ipoib_dbg_level >= (_level_) && \\r
(g_ipoib_dbg_flags & (_flag_)) ) \\r
{ \\r
/*\r
* Copyright (c) 2005 SilverStorm Technologies. All rights reserved.\r
* Copyright (c) 2006 Mellanox Technologies. All rights reserved.\r
+ * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.\r
*\r
* This software is available to you under the OpenIB.org BSD license\r
* below:\r
{NDIS_STRING_CONST("SaTimeout"), 1, IPOIB_OFFSET(sa_timeout), IPOIB_SIZE(sa_timeout), 1000, 250, UINT_MAX},\r
{NDIS_STRING_CONST("SaRetries"), 1, IPOIB_OFFSET(sa_retry_cnt), IPOIB_SIZE(sa_retry_cnt), 10, 1, UINT_MAX},\r
{NDIS_STRING_CONST("RecvRatio"), 1, IPOIB_OFFSET(recv_pool_ratio), IPOIB_SIZE(recv_pool_ratio), 1, 1, 10},\r
- {NDIS_STRING_CONST("PayloadMtu"), 1, IPOIB_OFFSET(payload_mtu), IPOIB_SIZE(payload_mtu), MAX_UD_PAYLOAD_MTU, 60, MAX_CM_PAYLOAD_MTU},\r
+ {NDIS_STRING_CONST("PayloadMtu"), 1, IPOIB_OFFSET(payload_mtu), IPOIB_SIZE(payload_mtu), 2044, 60, 4092},\r
+ {NDIS_STRING_CONST("MCLeaveRescan"), 1, IPOIB_OFFSET(mc_leave_rescan), IPOIB_SIZE(mc_leave_rescan), 260, 1, 3600},\r
{NDIS_STRING_CONST("CmEnabled"), 1, IPOIB_OFFSET(cm_enabled), IPOIB_SIZE(cm_enabled), 0, 0, 1}\r
}; \r
\r
g_ipoib_dbg_flags));\r
\r
#if DBG\r
- if( g_ipoib_dbg_flags & IPOIB_DBG_ERROR )\r
+ if( g_ipoib_dbg_flags & IPOIB_DBG_ERR )\r
g_ipoib_dbg_flags |= CL_DBG_ERROR;\r
#endif\r
\r
p_adapter->params.payload_mtu = \r
min( MAX_UD_PAYLOAD_MTU, p_adapter->params.payload_mtu);\r
p_adapter->params.xfer_block_size = (sizeof(eth_hdr_t) + p_adapter->params.payload_mtu);\r
-\r
NdisReadNetworkAddress( &status, &mac, &len, h_config );\r
\r
ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr, p_adapter->mac.addr );\r
{\r
/* Required General */\r
case OID_GEN_SUPPORTED_LIST:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_SUPPORTED_LIST\n", port_num) );\r
src_buf = (PVOID)SUPPORTED_OIDS;\r
buf_len = sizeof(SUPPORTED_OIDS);\r
break;\r
\r
case OID_GEN_HARDWARE_STATUS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_HARDWARE_STATUS\n", port_num) );\r
cl_obj_lock( &p_adapter->obj );\r
switch( p_adapter->state )\r
{\r
case IB_PNP_PORT_ADD:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NdisHardwareStatusInitializing\n", port_num) );\r
info = NdisHardwareStatusInitializing;\r
break;\r
\r
case IB_PNP_PORT_ACTIVE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NdisHardwareStatusReady\n", port_num) );\r
info = NdisHardwareStatusReady;\r
break;\r
\r
default:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NdisHardwareStatusNotReady\n", port_num) );\r
info = NdisHardwareStatusNotReady;\r
}\r
\r
case OID_GEN_MEDIA_SUPPORTED:\r
case OID_GEN_MEDIA_IN_USE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MEDIA_SUPPORTED "\r
"or OID_GEN_MEDIA_IN_USE\n", port_num) );\r
info = NdisMedium802_3;\r
break;\r
\r
case OID_GEN_MAXIMUM_FRAME_SIZE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MAXIMUM_FRAME_SIZE\n", port_num) );\r
- if( p_adapter->params.cm_enabled )\r
- info = p_adapter->params.cm_payload_mtu;\r
- else\r
- info = p_adapter->params.payload_mtu;\r
+ info = p_adapter->params.payload_mtu;\r
break;\r
\r
case OID_GEN_LINK_SPEED:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_LINK_SPEED\n", port_num) );\r
cl_obj_lock( &p_adapter->obj );\r
switch( p_adapter->state )\r
/* Save the request parameters. */\r
p_adapter->query_oid = oid_info;\r
\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NDIS_STATUS_PENDING\n", port_num) );\r
status = NDIS_STATUS_PENDING;\r
break;\r
\r
case IB_PNP_PORT_REMOVE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NDIS_STATUS_NOT_ACCEPTED\n", port_num) );\r
status = NDIS_STATUS_NOT_ACCEPTED;\r
break;\r
break;\r
\r
case OID_GEN_TRANSMIT_BUFFER_SPACE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_TRANSMIT_BUFFER_SPACE\n", port_num) );\r
if( p_adapter->params.cm_enabled )\r
info = p_adapter->params.sq_depth * p_adapter->params.cm_xfer_block_size;\r
break;\r
\r
case OID_GEN_RECEIVE_BUFFER_SPACE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\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
if( p_adapter->params.cm_enabled )\r
case OID_GEN_TRANSMIT_BLOCK_SIZE:\r
case OID_GEN_RECEIVE_BLOCK_SIZE:\r
case OID_GEN_MAXIMUM_TOTAL_SIZE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MAXIMUM_LOOKAHEAD "\r
"or OID_GEN_CURRENT_LOOKAHEAD or "\r
"OID_GEN_TRANSMIT_BLOCK_SIZE or "\r
break;\r
\r
case OID_GEN_VENDOR_ID:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_VENDOR_ID\n", port_num) );\r
src_buf = (void*)VENDOR_ID;\r
buf_len = sizeof(VENDOR_ID);\r
break;\r
\r
case OID_GEN_VENDOR_DESCRIPTION:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID, \r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID, \r
("Port %d received query for OID_GEN_VENDOR_DESCRIPTION\n", port_num) );\r
src_buf = VENDOR_DESCRIPTION;\r
buf_len = sizeof(VENDOR_DESCRIPTION);\r
break;\r
\r
case OID_GEN_VENDOR_DRIVER_VERSION:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_VENDOR_DRIVER_VERSION\n", port_num) );\r
src_buf = &version;\r
buf_len = sizeof(version);\r
break;\r
\r
case OID_GEN_PHYSICAL_MEDIUM:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_PHYSICAL_MEDIUM\n", port_num) );\r
info = NdisPhysicalMediumUnspecified;\r
break;\r
\r
case OID_GEN_CURRENT_PACKET_FILTER:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_CURRENT_PACKET_FILTER\n", port_num) );\r
info = p_adapter->packet_filter;\r
break;\r
\r
case OID_GEN_DRIVER_VERSION:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_DRIVER_VERSION\n", port_num) );\r
src_buf = &version;\r
buf_len = sizeof(version);\r
break;\r
\r
case OID_GEN_MAC_OPTIONS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MAC_OPTIONS\n", port_num) );\r
info = NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA |\r
NDIS_MAC_OPTION_TRANSFERS_NOT_PEND |\r
break;\r
\r
case OID_GEN_MEDIA_CONNECT_STATUS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MEDIA_CONNECT_STATUS\n", port_num) );\r
cl_obj_lock( &p_adapter->obj );\r
switch( p_adapter->state )\r
p_adapter->pending_query = TRUE;\r
p_adapter->query_oid = oid_info;\r
\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NDIS_STATUS_PENDING\n", port_num) );\r
status = NDIS_STATUS_PENDING;\r
break;\r
\r
case IB_PNP_PORT_ACTIVE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NdisMediaStateConnected\n", port_num) );\r
info = NdisMediaStateConnected;\r
break;\r
\r
case IB_PNP_PORT_REMOVE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NDIS_STATUS_NOT_ACCEPTED\n", port_num) );\r
status = NDIS_STATUS_NOT_ACCEPTED;\r
break;\r
\r
default:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d returning NdisMediaStateDisconnected\n", port_num) );\r
info = NdisMediaStateDisconnected;\r
}\r
break;\r
\r
case OID_GEN_MAXIMUM_SEND_PACKETS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MAXIMUM_SEND_PACKETS\n", port_num) );\r
info = MAXULONG;\r
break;\r
\r
/* Required General Statistics */\r
case OID_GEN_XMIT_OK:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_XMIT_OK\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_SUCCESS, &oid_info );\r
break;\r
\r
case OID_GEN_RCV_OK:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_RCV_OK\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_SUCCESS, &oid_info );\r
break;\r
\r
case OID_GEN_XMIT_ERROR:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_XMIT_ERROR\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_ERROR, &oid_info );\r
break;\r
\r
case OID_GEN_RCV_ERROR:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_RCV_ERROR\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_ERROR, &oid_info );\r
break;\r
\r
case OID_GEN_RCV_NO_BUFFER:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_RCV_NO_BUFFER\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_DROPPED, &oid_info );\r
break;\r
\r
case OID_GEN_DIRECTED_BYTES_XMIT:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_DIRECTED_BYTES_XMIT\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_UCAST_BYTES, &oid_info );\r
break;\r
\r
case OID_GEN_DIRECTED_FRAMES_XMIT:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_DIRECTED_FRAMES_XMIT\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_UCAST_FRAMES, &oid_info );\r
break;\r
\r
case OID_GEN_MULTICAST_BYTES_XMIT:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MULTICAST_BYTES_XMIT\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_MCAST_BYTES, &oid_info );\r
break;\r
\r
case OID_GEN_MULTICAST_FRAMES_XMIT:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MULTICAST_FRAMES_XMIT\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_MCAST_FRAMES, &oid_info );\r
break;\r
\r
case OID_GEN_BROADCAST_BYTES_XMIT:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_BROADCAST_BYTES_XMIT\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_BCAST_BYTES, &oid_info );\r
break;\r
\r
case OID_GEN_BROADCAST_FRAMES_XMIT:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_BROADCAST_FRAMES_XMIT\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_send_stat( p_adapter, IP_STAT_BCAST_FRAMES, &oid_info );\r
break;\r
\r
case OID_GEN_DIRECTED_BYTES_RCV:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_DIRECTED_BYTES_RCV\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_UCAST_BYTES, &oid_info );\r
break;\r
\r
case OID_GEN_DIRECTED_FRAMES_RCV:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_DIRECTED_FRAMES_RCV\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_UCAST_FRAMES, &oid_info );\r
break;\r
\r
case OID_GEN_MULTICAST_BYTES_RCV:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MULTICAST_BYTES_RCV\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_MCAST_BYTES, &oid_info );\r
break;\r
\r
case OID_GEN_MULTICAST_FRAMES_RCV:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_MULTICAST_FRAMES_RCV\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_MCAST_FRAMES, &oid_info );\r
break;\r
\r
case OID_GEN_BROADCAST_BYTES_RCV:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_BROADCAST_BYTES_RCV\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_BCAST_BYTES, &oid_info );\r
break;\r
\r
case OID_GEN_BROADCAST_FRAMES_RCV:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_GEN_BROADCAST_FRAMES_RCV\n", port_num) );\r
src_buf = NULL;\r
status = ipoib_get_recv_stat( p_adapter, IP_STAT_BCAST_FRAMES, &oid_info );\r
\r
/* Required Ethernet operational characteristics */\r
case OID_802_3_PERMANENT_ADDRESS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_802_3_PERMANENT_ADDRESS\n", port_num) );\r
src_buf = &p_adapter->mac;\r
buf_len = sizeof(p_adapter->mac);\r
break;\r
\r
case OID_802_3_CURRENT_ADDRESS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_802_3_CURRENT_ADDRESS\n", port_num) );\r
src_buf = &p_adapter->params.conf_mac;\r
buf_len = sizeof(p_adapter->params.conf_mac);\r
break;\r
\r
case OID_802_3_MULTICAST_LIST:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_802_3_MULTICAST_LIST\n", port_num) );\r
src_buf = p_adapter->mcast_array;\r
buf_len = p_adapter->mcast_array_size * sizeof(mac_addr_t);\r
break;\r
\r
case OID_802_3_MAXIMUM_LIST_SIZE:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_802_3_MAXIMUM_LIST_SIZE\n", port_num) );\r
info = MAX_MCAST;\r
break;\r
\r
case OID_802_3_MAC_OPTIONS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_802_3_MAC_OPTIONS\n", port_num) );\r
info = 0;\r
break;\r
case OID_802_3_RCV_ERROR_ALIGNMENT:\r
case OID_802_3_XMIT_ONE_COLLISION:\r
case OID_802_3_XMIT_MORE_COLLISIONS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received query for OID_802_3_RCV_ERROR_ALIGNMENT or "\r
"OID_802_3_XMIT_ONE_COLLISION or "\r
"OID_802_3_XMIT_MORE_COLLISIONS\n", port_num) );\r
case OID_802_3_XMIT_LATE_COLLISIONS:\r
case OID_PNP_CAPABILITIES:\r
status = NDIS_STATUS_NOT_SUPPORTED;\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received an unsupported oid of 0x%.8X!\n", port_num, oid) );\r
break;\r
\r
#endif\r
default:\r
status = NDIS_STATUS_INVALID_OID;\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received an invalid oid of 0x%.8X!\n", port_num, oid) );\r
break;\r
}\r
{\r
if( p_oid_info->buf_len < buf_len )\r
{\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Insufficient buffer space. "\r
"Returning NDIS_STATUS_INVALID_LENGTH.\n") );\r
oid_status = NDIS_STATUS_INVALID_LENGTH;\r
}\r
else\r
{\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Returning NDIS_NOT_ACCEPTED") );\r
oid_status = NDIS_STATUS_NOT_ACCEPTED;\r
}\r
NDIS_TASK_OFFLOAD *p_offload_task;\r
NDIS_TASK_TCP_IP_CHECKSUM *p_offload_chksum;\r
\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received set for OID_TCP_TASK_OFFLOAD\n",\r
p_adapter->guids.port_num) );\r
\r
{\r
/* Required General */\r
case OID_GEN_CURRENT_PACKET_FILTER:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received set for OID_GEN_CURRENT_PACKET_FILTER\n", port_num));\r
if( info_buf_len < sizeof(p_adapter->packet_filter) )\r
{\r
break;\r
\r
case OID_GEN_CURRENT_LOOKAHEAD:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received set for OID_GEN_CURRENT_LOOKAHEAD\n", port_num));\r
if( info_buf_len < buf_len )\r
status = NDIS_STATUS_INVALID_LENGTH;\r
break;\r
\r
case OID_GEN_PROTOCOL_OPTIONS:\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d received set for OID_GEN_PROTOCOL_OPTIONS\n", port_num));\r
if( info_buf_len < buf_len )\r
status = NDIS_STATUS_INVALID_LENGTH;\r
("Port %d received set for OID_802_3_MULTICAST_LIST\n", port_num) );\r
if( info_buf_len > MAX_MCAST * sizeof(mac_addr_t) )\r
{\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d OID_802_3_MULTICAST_LIST - Multicast list full.\n", port_num) );\r
status = NDIS_STATUS_MULTICAST_FULL;\r
*p_bytes_needed = MAX_MCAST * sizeof(mac_addr_t);\r
}\r
else if( info_buf_len % sizeof(mac_addr_t) )\r
{\r
- IPOIB_PRINT( TRACE_LEVEL_VERBOSE,IPOIB_DBG_OID,\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
("Port %d OID_802_3_MULTICAST_LIST - Invalid input buffer.\n", port_num) );\r
status = NDIS_STATUS_INVALID_DATA;\r
}\r
CL_ASSERT( p_reg_svc_rec );\r
CL_ASSERT( p_reg_svc_rec->svc_context );\r
\r
- p_reg = (ats_reg_t* __ptr64)p_reg_svc_rec->svc_context;\r
+ p_reg = (ats_reg_t*)p_reg_svc_rec->svc_context;\r
port_num = p_reg->p_adapter->guids.port_num;\r
\r
cl_obj_lock( &p_reg->p_adapter->obj );\r
\r
IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
\r
- p_endpt = (ipoib_endpt_t*__ptr64)p_query_rec->query_context;\r
+ p_endpt = (ipoib_endpt_t*)p_query_rec->query_context;\r
p_port = __endpt_parent( p_endpt );\r
\r
cl_obj_lock( &p_endpt->obj );\r
#include "ipoib_debug.h"\r
\r
\r
-//typedef struct _ipoib_recv_desc ipoib_recv_desc_t;\r
\r
typedef struct _endpt_buf_mgr\r
{\r
cl_event_t remove_event;\r
\r
ib_al_ifc_t *p_ifc;\r
-\r
+ boolean_t is_in_use;\r
+ boolean_t is_mcast_listener;\r
} ipoib_endpt_t;\r
/*\r
* FIELDS\r
#include "ipoib_driver.h"\r
#include "ipoib_adapter.h"\r
#include "ipoib_port.h"\r
-#include "ipoib_endpoint.h"\r
#include "ipoib_debug.h"\r
#if defined(EVENT_TRACING)\r
#ifdef offsetof\r
\r
switch( pIoStack->Parameters.DeviceIoControl.IoControlCode )\r
{\r
- case IOCTL_IBAT_PORTS: //check_done, fixed print_ips\r
+ case IOCTL_IBAT_PORTS:\r
IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,\r
("IOCTL_IBAT_PORTS received\n") );\r
status = __ibat_get_ports( pIrp, pIoStack );\r
break;\r
\r
- case IOCTL_IBAT_IP_ADDRESSES: //check_done, fixed query_ip_address,CProvider::QueryAddressList,print_ips\r
+ case IOCTL_IBAT_IP_ADDRESSES:\r
IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,\r
("IOCTL_IBAT_IP_ADDRESSES received\n" ));\r
status = __ibat_get_ips( pIrp, pIoStack );\r
break;\r
\r
- case IOCTL_IBAT_MAC_TO_GID: //check_done, fixed remote_ip, SdpArp::DestPortGidFromMac\r
+ case IOCTL_IBAT_MAC_TO_GID:\r
IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,\r
("IOCTL_IBAT_MAC_TO_GID received\n" ));\r
status = __ibat_mac_to_gid( pIrp, pIoStack );\r
break;\r
\r
- case IOCTL_IBAT_IP_TO_PORT: //check_done, fixed CProvider::OpenAdapter\r
+ case IOCTL_IBAT_IP_TO_PORT:\r
IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,\r
("IOCTL_IBAT_IP_TO_PORT received\n" ));\r
status = __ibat_ip_to_port( pIrp, pIoStack );\r
Language=English\r
%2: Incorrect value or non-existing registry for the optional IPoIB parameter %3, overriding it by default value: %4\r
.\r
+\r
+MessageId=0x005B\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_PARTITION_ERR\r
+Language=English\r
+%2: Pkey index not found for partition , change switch pkey configuration.\r
+.\r
+\r
ipoib_port_t *gp_ipoib_port;\r
#endif\r
\r
-\r
+static void __port_mcast_garbage_dpc(KDPC *p_gc_dpc,void *context,void *s_arg1, void *s_arg2);\r
+static void __port_do_mcast_garbage(ipoib_port_t* const p_port );\r
/******************************************************************************\r
*\r
* Declarations\r
IN ipoib_port_t* const p_port,\r
IN ib_ca_attr_t** pp_ca_attrs );\r
\r
-static uint16_t\r
-__port_get_pkey_index(\r
- IN ib_ca_attr_t* const p_ca_attrs,\r
- IN ib_net16_t pkey );\r
static void\r
__srq_async_event_cb(\r
IN ib_async_event_rec_t *p_event_rec );\r
IN size_t buf_len,\r
IN OUT ipoib_send_desc_t* const p_desc );\r
\r
+static NDIS_STATUS\r
+__send_mgr_filter_igmp_v2(\r
+ IN ipoib_port_t* const p_port,\r
+ IN const ip_hdr_t* const p_ip_hdr,\r
+ IN size_t iph_options_size,\r
+ IN NDIS_BUFFER* p_buf,\r
+ IN size_t buf_len );\r
+\r
static NDIS_STATUS\r
__send_mgr_filter_udp(\r
IN ipoib_port_t* const p_port,\r
IN void *context );\r
\r
\r
-static void\r
-__endpt_cm_init(\r
- IN void* p_context );\r
-\r
-static ib_api_status_t\r
-__endpt_cm_init_endpt(\r
- IN ipoib_endpt_t* const p_endpt );\r
-\r
static intn_t\r
__gid_cmp(\r
IN const void* const p_key1,\r
#endif\r
}\r
\r
+/* function returns pointer to payload that is going after IP header.\r
+* asssuming that payload and IP header are in the same buffer\r
+*/\r
+static void* GetIpPayloadPtr(const ip_hdr_t* const p_ip_hdr)\r
+{\r
+ return (void*)((uint8_t*)p_ip_hdr + 4*(p_ip_hdr->ver_hl & 0xf));\r
+}\r
\r
/******************************************************************************\r
*\r
p_adapter->p_ifc->get_err_str( status )) );\r
return status;\r
}\r
+ /* Initialize multicast garbage collector timer and DPC object */\r
+ KeInitializeDpc(&p_port->gc_dpc,(PKDEFERRED_ROUTINE)__port_mcast_garbage_dpc,p_port);\r
+ KeInitializeTimerEx(&p_port->gc_timer,SynchronizationTimer);\r
\r
/* We only ever destroy from the PnP callback thread. */\r
cl_status = cl_obj_init( &p_port->obj, CL_DESTROY_SYNC,\r
\r
p_port = PARENT_STRUCT( p_obj, ipoib_port_t, obj );\r
\r
+ KeCancelTimer(&p_port->gc_timer);\r
+ KeFlushQueuedDpcs();\r
__endpt_mgr_destroy( p_port );\r
__recv_mgr_destroy( p_port );\r
__send_mgr_destroy( p_port );\r
("Query CA attributes failed\n" ) );\r
return status;\r
}\r
- p_port->pkey_index = __port_get_pkey_index( p_port->p_ca_attrs,\r
- p_port->p_adapter->guids.port_guid.pkey );\r
-\r
/* Allocate the PD. */\r
status = p_port->p_adapter->p_ifc->alloc_pd(\r
p_port->ib_mgr.h_ca, IB_PDT_UD, p_port, &p_port->ib_mgr.h_pd );\r
IN ib_async_event_rec_t *p_event_rec )\r
{\r
ipoib_port_t* p_port = \r
- (ipoib_port_t * __ptr64 )p_event_rec->context;\r
+ (ipoib_port_t *)p_event_rec->context;\r
\r
switch( p_event_rec->code )\r
{\r
return ib_status;\r
}\r
\r
-static uint16_t\r
-__port_get_pkey_index(\r
- IN ib_ca_attr_t* const p_ca_attrs,\r
- IN ib_net16_t pkey )\r
-{\r
- uint16_t index;\r
- CL_ASSERT( p_ca_attrs->p_port_attr->p_pkey_table[0] == IB_DEFAULT_PKEY );\r
- for( index = 0; index < p_ca_attrs->p_port_attr->num_pkeys; index++ )\r
- {\r
- if( p_ca_attrs->p_port_attr->p_pkey_table[index] == pkey )\r
- return index;\r
- }\r
- return 0;\r
-}\r
-\r
void\r
ipoib_port_srq_destroy( \r
IN ipoib_port_t* const p_port )\r
\r
cl_perf_start( ReturnPacket );\r
\r
- /* Get the port from the packet. */\r
+ /* Get the port and descriptor from the packet. */\r
p_port = IPOIB_PORT_FROM_PACKET( p_packet );\r
\r
cl_spinlock_acquire( &p_port->recv_lock );\r
\r
}\r
/* Successful completion. Get the receive information. */\r
+ p_desc->ndis_csum.Value = (ULONG) p_wc->csum_ok;\r
cl_perf_start( GetRecvEndpts );\r
__recv_get_endpts( p_port, p_desc, p_wc, &p_src, &p_dst );\r
cl_perf_stop( &p_port->p_adapter->perf, GetRecvEndpts );\r
}\r
else\r
{\r
+ ip_stat_sel_t ip_stat;\r
p_desc->len =\r
len + sizeof(eth_hdr_t) - sizeof(ipoib_hdr_t);\r
if( p_dst->h_mcast)\r
p_dst->dgid.multicast.raw_group_id[13] == 0xFF )\r
{\r
p_desc->type = PKT_TYPE_BCAST;\r
+ ip_stat = IP_STAT_BCAST_BYTES;\r
}\r
else\r
{\r
p_desc->type = PKT_TYPE_MCAST;\r
+ ip_stat = IP_STAT_MCAST_BYTES;\r
}\r
}\r
else\r
{\r
p_desc->type = PKT_TYPE_UCAST;\r
+ ip_stat = IP_STAT_UCAST_BYTES;\r
+ \r
}\r
cl_qlist_insert_tail( p_done_list, &p_desc->item.list_item );\r
+ ipoib_inc_recv_stat( p_port->p_adapter, ip_stat, len, 1 ); \r
}\r
}\r
\r
p_eth->hdr.src = p_src->mac;\r
p_eth->hdr.dst = p_dst->mac;\r
\r
+ if ( p_eth->hdr.dst.addr[0] == 1 && \r
+ p_eth->hdr.type == ETH_PROT_TYPE_IP &&\r
+ p_eth->hdr.dst.addr[2] == 0x5E) \r
+ {\r
+ p_eth->hdr.dst.addr[1] = 0;\r
+ p_eth->hdr.dst.addr[3] = p_eth->hdr.dst.addr[3] & 0x7f;\r
+ }\r
+ if (p_dst->h_mcast)\r
+ p_dst->is_in_use = TRUE;\r
+\r
IPOIB_EXIT( IPOIB_DBG_RECV );\r
return IB_SUCCESS;\r
}\r
if( p_ib_arp->prot_type != ETH_PROT_TYPE_IP )\r
{\r
IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
- ("ARP protocol type not IP\n") );\r
+ ("ARP protocal type not IP\n") );\r
return IB_INVALID_SETTING;\r
}\r
\r
NDIS_STATUS status;\r
uint32_t pkt_filter;\r
ip_stat_sel_t type;\r
- NDIS_TCP_IP_CHECKSUM_PACKET_INFO chksum;\r
PERF_DECLARE( GetNdisPkt );\r
\r
IPOIB_ENTER( IPOIB_DBG_RECV );\r
return IB_INSUFFICIENT_RESOURCES;\r
}\r
\r
- /* Flag the checksums as having been calculated. */\r
- chksum.Value = 0;\r
- chksum.Receive.NdisPacketTcpChecksumSucceeded = TRUE;\r
- chksum.Receive.NdisPacketUdpChecksumSucceeded = TRUE;\r
- chksum.Receive.NdisPacketIpChecksumSucceeded = TRUE;\r
- NDIS_PER_PACKET_INFO_FROM_PACKET( *pp_packet, TcpIpChecksumPacketInfo ) =\r
- (void*)(uintn_t)chksum.Value;\r
-\r
+ /* Get the checksums directly from packet information. */\r
+ NDIS_PER_PACKET_INFO_FROM_PACKET( *pp_packet, TcpIpChecksumPacketInfo ) = \r
+ (PVOID) (uintn_t) (p_desc->ndis_csum.Value);\r
ipoib_inc_recv_stat( p_port->p_adapter, type, p_desc->len, 1 );\r
\r
IPOIB_EXIT( IPOIB_DBG_RECV );\r
if( p_ip_hdr->offset ||\r
p_ip_hdr->prot != IP_PROT_UDP )\r
{\r
+ /* Check if this packet is IGMP */\r
+ if ( p_ip_hdr->prot == IP_PROT_IGMP ) \r
+ {\r
+ /*\r
+ In igmp packet I saw that iph arrive in 2 NDIS_BUFFERs:\r
+ 1. iph\r
+ 2. ip options\r
+ So to get the IGMP packet we need to skip the ip options NDIS_BUFFER\r
+ */\r
+ size_t iph_size_in_bytes = (p_ip_hdr->ver_hl & 0xf) * 4;\r
+ size_t iph_options_size = iph_size_in_bytes - buf_len;\r
+ buf_len -= sizeof(ip_hdr_t);//without ipheader\r
+\r
+ /*\r
+ Could be a case that arrived igmp packet not from type IGMPv2 ,\r
+ but IGMPv1 or IGMPv3.\r
+ We anyway pass it to __send_mgr_filter_igmp_v2().\r
+ */\r
+ __send_mgr_filter_igmp_v2(p_port, p_ip_hdr, iph_options_size, p_buf, buf_len);\r
+ }\r
/* Not a UDP packet. */\r
cl_perf_start( SendTcp );\r
status = __send_gen( p_port, p_desc );\r
return status;\r
}\r
\r
+static NDIS_STATUS\r
+__send_mgr_filter_igmp_v2(\r
+ IN ipoib_port_t* const p_port,\r
+ IN const ip_hdr_t* const p_ip_hdr,\r
+ IN size_t iph_options_size,\r
+ IN NDIS_BUFFER* p_buf,\r
+ IN size_t buf_len )\r
+{\r
+ igmp_v2_hdr_t *p_igmp_v2_hdr = NULL;\r
+ NDIS_STATUS endpt_status;\r
+ ipoib_endpt_t* p_endpt = NULL;\r
+ mac_addr_t fake_mcast_mac;\r
+\r
+ IPOIB_ENTER( IPOIB_DBG_SEND );\r
+\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,\r
+ ("buf_len = %d,iph_options_size = %d\n",(int)buf_len,(int)iph_options_size ) );\r
+\r
+ if( !buf_len )\r
+ {\r
+ // To get the IGMP packet we need to skip the ip options NDIS_BUFFER (if exists)\r
+ while ( iph_options_size )\r
+ {\r
+ NdisGetNextBuffer( p_buf, &p_buf );\r
+ if( !p_buf )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Failed to get IGMPv2 header buffer.\n") );\r
+ return NDIS_STATUS_FAILURE;\r
+ }\r
+ NdisQueryBufferSafe( p_buf, &p_igmp_v2_hdr, &buf_len, NormalPagePriority );\r
+ if( !p_igmp_v2_hdr )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Failed to query IGMPv2 header buffer.\n") );\r
+ return NDIS_STATUS_FAILURE;\r
+ }\r
+ iph_options_size-=buf_len;\r
+ }\r
+ \r
+ NdisGetNextBuffer( p_buf, &p_buf );\r
+ if( !p_buf )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Failed to get IGMPv2 header buffer.\n") );\r
+ return NDIS_STATUS_FAILURE;\r
+ }\r
+ NdisQueryBufferSafe( p_buf, &p_igmp_v2_hdr, &buf_len, NormalPagePriority );\r
+ if( !p_igmp_v2_hdr )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Failed to query IGMPv2 header buffer.\n") );\r
+ return NDIS_STATUS_FAILURE;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ /* assuming ip header and options are in the same packet */\r
+ p_igmp_v2_hdr = GetIpPayloadPtr(p_ip_hdr);\r
+ }\r
+ /* Get the IGMP header length. */\r
+ if( buf_len < sizeof(igmp_v2_hdr_t) )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Buffer not large enough for IGMPv2 packet.\n") );\r
+ return NDIS_STATUS_BUFFER_TOO_SHORT;\r
+ }\r
+\r
+ // build fake mac from igmp packet group address\r
+ fake_mcast_mac.addr[0] = 1;\r
+ fake_mcast_mac.addr[1] = ((unsigned char*)&p_igmp_v2_hdr->group_address)[0] & 0x0f;\r
+ fake_mcast_mac.addr[2] = 0x5E;\r
+ fake_mcast_mac.addr[3] = ((unsigned char*)&p_igmp_v2_hdr->group_address)[1];\r
+ fake_mcast_mac.addr[4] = ((unsigned char*)&p_igmp_v2_hdr->group_address)[2];\r
+ fake_mcast_mac.addr[5] = ((unsigned char*)&p_igmp_v2_hdr->group_address)[3];\r
+\r
+ switch ( p_igmp_v2_hdr->type )\r
+ {\r
+ case IGMP_V2_MEMBERSHIP_REPORT:\r
+ /* \r
+ This mean that some body open listener on this group \r
+ Change type of mcast endpt to SEND_RECV endpt. So mcast garbage collector \r
+ will not delete this mcast endpt.\r
+ */\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,\r
+ ("Catched IGMP_V2_MEMBERSHIP_REPORT message\n") );\r
+ endpt_status = __endpt_mgr_ref( p_port, fake_mcast_mac, &p_endpt );\r
+ if ( p_endpt )\r
+ {\r
+ cl_obj_lock( &p_port->obj );\r
+ p_endpt->is_mcast_listener = TRUE;\r
+ cl_obj_unlock( &p_port->obj );\r
+ ipoib_endpt_deref( p_endpt );\r
+ }\r
+ break;\r
+\r
+ case IGMP_V2_LEAVE_GROUP:\r
+ /* \r
+ This mean that somebody CLOSE listener on this group .\r
+ Change type of mcast endpt to SEND_ONLY endpt. So mcast \r
+ garbage collector will delete this mcast endpt next time.\r
+ */\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,\r
+ ("Catched IGMP_V2_LEAVE_GROUP message\n") );\r
+ endpt_status = __endpt_mgr_ref( p_port, fake_mcast_mac, &p_endpt );\r
+ if ( p_endpt )\r
+ {\r
+ cl_obj_lock( &p_port->obj );\r
+ p_endpt->is_mcast_listener = FALSE;\r
+ p_endpt->is_in_use = FALSE;\r
+ cl_obj_unlock( &p_port->obj );\r
+ ipoib_endpt_deref( p_endpt );\r
+ }\r
+\r
+ __port_do_mcast_garbage(p_port);\r
+\r
+ break;\r
+\r
+ default:\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,\r
+ ("Send Unknown IGMP message: 0x%x \n", p_igmp_v2_hdr->type ) );\r
+ break;\r
+ }\r
+\r
+ IPOIB_EXIT( IPOIB_DBG_SEND );\r
+ return NDIS_STATUS_SUCCESS;\r
+}\r
\r
static NDIS_STATUS\r
__send_mgr_filter_udp(\r
}\r
else\r
{\r
- p_udp_hdr = (udp_hdr_t*)(p_ip_hdr + 1);\r
+ p_udp_hdr = (udp_hdr_t*)GetIpPayloadPtr(p_ip_hdr);\r
}\r
/* Get the UDP header and check the destination port numbers. */\r
if( buf_len < sizeof(udp_hdr_t) )\r
return status;\r
}\r
\r
+unsigned short ipchksum(unsigned short *ip, int len)\r
+{\r
+ unsigned long sum = 0;\r
+\r
+ len >>= 1;\r
+ while (len--) {\r
+ sum += *(ip++);\r
+ if (sum > 0xFFFF)\r
+ sum -= 0xFFFF;\r
+ }\r
+ return (unsigned short)((~sum) & 0x0000FFFF);\r
+}\r
\r
static NDIS_STATUS\r
__send_mgr_filter_dhcp(\r
{\r
IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
("Can't convert CID to IPoIB format.\n") );\r
- return IB_INSUFFICIENT_MEMORY;\r
+ return NDIS_STATUS_RESOURCES;\r
}\r
/* Move the existing options down, and add a new CID option */\r
len = p_option - ( p_cid + p_cid[1] + 2 );\r
cl_memcpy( &p_cid[7], &gid, sizeof(ib_gid_t) );\r
cl_memcpy( &p_cid[3], &p_port->ib_mgr.qpn, sizeof(p_port->ib_mgr.qpn) ); \r
p_ib_dhcp->htype = DHCP_HW_TYPE_IB;\r
+\r
+ /* update lengths to include any change we made */\r
+ p_desc->p_buf->ip.hdr.length = cl_ntoh16( sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t) );\r
+ p_desc->p_buf->ip.prot.udp.hdr.length = cl_ntoh16( sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t) );\r
+\r
+ /* update crc in ip header */\r
+ if( !p_port->p_adapter->params.send_chksum_offload )\r
+ {\r
+ p_desc->p_buf->ip.hdr.chksum = 0;\r
+ p_desc->p_buf->ip.hdr.chksum = ipchksum((unsigned short*) &p_desc->p_buf->ip.hdr, sizeof(ip_hdr_t));\r
+ }\r
break;\r
\r
/* Server messages. */\r
net32_t qpn = 0;\r
status = __endpt_mgr_get_gid_qpn( p_port, p_arp->dst_hw,\r
&p_ib_arp->dst_hw.gid, &qpn );\r
- \r
if( status != NDIS_STATUS_SUCCESS )\r
{\r
IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) )\r
{\r
if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst, \r
- IB_MC_REC_STATE_SEND_ONLY_MEMBER) == IB_SUCCESS )\r
+ IB_MC_REC_STATE_FULL_MEMBER) == IB_SUCCESS )\r
{\r
IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
("Multicast Mac - trying to join.\n") );\r
return NDIS_STATUS_PENDING;\r
}\r
}\r
+ else if ( status == NDIS_STATUS_SUCCESS && \r
+ ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) && \r
+ !ETH_IS_BROADCAST( p_eth_hdr->dst.addr ) )\r
+ {\r
+ CL_ASSERT( (*pp_endpt) );\r
+ CL_ASSERT((*pp_endpt)->h_mcast != NULL);\r
+ (*pp_endpt)->is_in_use = TRUE;\r
+ }\r
\r
IPOIB_EXIT( IPOIB_DBG_SEND );\r
return status;\r
{\r
NDIS_STATUS status;\r
int32_t hdr_idx;\r
+ PNDIS_PACKET_EXTENSION PktExt;\r
+ PNDIS_TCP_IP_CHECKSUM_PACKET_INFO pChecksumPktInfo; //NDIS 5.1\r
\r
PERF_DECLARE( SendMgrFilter );\r
\r
p_desc->wr.wr_id = (uintn_t)p_desc->p_pkt;\r
p_desc->wr.wr_type = WR_SEND;\r
p_desc->wr.send_opt = IB_SEND_OPT_SIGNALED;\r
+ \r
+ PktExt = NDIS_PACKET_EXTENSION_FROM_PACKET(p_desc->p_pkt);\r
+ pChecksumPktInfo = (PNDIS_TCP_IP_CHECKSUM_PACKET_INFO)&PktExt->NdisPacketInfo[TcpIpChecksumPacketInfo];\r
+ if(p_port->p_adapter->params.send_chksum_offload & \r
+ (pChecksumPktInfo->Transmit.NdisPacketChecksumV4 || pChecksumPktInfo->Transmit.NdisPacketChecksumV6))\r
+ {\r
+ // Set transimition checksum offloading \r
+ if (pChecksumPktInfo->Transmit.NdisPacketIpChecksum) \r
+ {\r
+ p_desc->wr.send_opt |= IB_SEND_OPT_TX_IP_CSUM;\r
+ }\r
+ if(pChecksumPktInfo->Transmit.NdisPacketTcpChecksum ) \r
+ {\r
+ p_desc->wr.send_opt |= IB_SEND_OPT_TX_TCP_UDP_CSUM;\r
+ }\r
+ }\r
+ \r
p_desc->wr.ds_array = p_desc->local_ds;\r
\r
if( ETH_IS_UNICAST( p_eth_hdr->dst.addr ) && \r
}\r
\r
cl_perf_start( SendMgrQueue );\r
+\r
+ if ( ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) && \r
+ p_eth_hdr->type == ETH_PROT_TYPE_IP &&\r
+ !ETH_IS_BROADCAST( p_eth_hdr->dst.addr ) ) \r
+ {\r
+ ip_hdr_t *p_ip_hdr;\r
+ NDIS_BUFFER *p_ip_hdr_buf;\r
+ UINT ip_hdr_buf_len;\r
+\r
+ // Extract the ip hdr \r
+ NdisGetNextBuffer( p_buf, &p_ip_hdr_buf );\r
+ if( !p_ip_hdr_buf )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Failed to get IP header buffer.\n") );\r
+ goto h_end;\r
+ }\r
+ \r
+ NdisQueryBufferSafe( p_ip_hdr_buf, &p_ip_hdr, &ip_hdr_buf_len, NormalPagePriority );\r
+ if( !p_ip_hdr )\r
+ {\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Failed to query IP header buffer.\n") );\r
+ goto h_end;\r
+ }\r
+\r
+ if( ip_hdr_buf_len < sizeof(ip_hdr_t) )\r
+ {\r
+ /* This buffer is done for. Get the next buffer. */\r
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+ ("Buffer too small for IP packet.\n") );\r
+ goto h_end;\r
+ }\r
+ \r
+ p_eth_hdr->dst.addr[1] = ((unsigned char*)&p_ip_hdr->dst_ip)[0] & 0x0f;\r
+ p_eth_hdr->dst.addr[3] = ((unsigned char*)&p_ip_hdr->dst_ip)[1];\r
+ }\r
+h_end:\r
status = __send_mgr_queue( p_port, p_eth_hdr, &desc.p_endpt );\r
cl_perf_stop( &p_port->p_adapter->perf, SendMgrQueue );\r
if( status == NDIS_STATUS_PENDING )\r
if( ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) )\r
{\r
if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst,\r
- IB_MC_REC_STATE_SEND_ONLY_MEMBER) == IB_SUCCESS )\r
+ IB_MC_REC_STATE_FULL_MEMBER) == IB_SUCCESS )\r
{\r
IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
("Multicast Mac - trying to join.\n") );\r
\r
cl_qlist_init( &mc_list );\r
cl_qlist_init( &conn_list );\r
-\r
cl_obj_lock( &p_port->obj );\r
/* Wait for all readers to complete. */\r
while( p_port->endpt_rdr )\r
return IB_INSUFFICIENT_RESOURCES;\r
}\r
/* set reference to transport to be used while is not attached to the port */\r
+ p_endpt->is_mcast_listener = TRUE;\r
p_endpt->p_ifc = p_port->p_adapter->p_ifc;\r
status = ipoib_endpt_set_mcast( p_endpt, p_port->ib_mgr.h_pd,\r
p_port->port_num, p_mcast_rec );\r
\r
IPOIB_ENTER( IPOIB_DBG_INIT );\r
\r
- p_port = (ipoib_port_t* __ptr64)p_query_rec->query_context;\r
+ p_port = (ipoib_port_t*)p_query_rec->query_context;\r
\r
cl_obj_lock( &p_port->obj );\r
p_port->ib_mgr.h_query = NULL;\r
\r
member_rec.mgid.raw[4] = (uint8_t) (p_port->p_adapter->guids.port_guid.pkey >> 8) ;\r
member_rec.mgid.raw[5] = (uint8_t) p_port->p_adapter->guids.port_guid.pkey;\r
- member_rec.pkey = p_port->p_adapter->guids.port_guid.pkey;\r
+ member_rec.pkey = cl_hton16(p_port->p_adapter->guids.port_guid.pkey);\r
cl_memclr( &query, sizeof(ib_query_req_t) );\r
query.query_type = IB_QUERY_USER_DEFINED;\r
query.p_query_input = &info;\r
\r
IPOIB_ENTER( IPOIB_DBG_INIT );\r
\r
- p_port = (ipoib_port_t* __ptr64)p_query_rec->query_context;\r
+ p_port = (ipoib_port_t*)p_query_rec->query_context;\r
\r
cl_obj_lock( &p_port->obj );\r
p_port->ib_mgr.h_query = NULL;\r
mcast_req.member_rec.mtu =\r
(IB_PATH_SELECTOR_EXACTLY << 6) | IB_MTU_LEN_2048;\r
\r
- mcast_req.member_rec.pkey = p_port->p_adapter->guids.port_guid.pkey;\r
+ mcast_req.member_rec.pkey = cl_hton16(p_port->p_adapter->guids.port_guid.pkey);\r
\r
mcast_req.member_rec.sl_flow_hop = ib_member_set_sl_flow_hop( 0, 0, 0 );\r
mcast_req.member_rec.scope_state =\r
KeWaitForSingleObject(\r
&p_port->sa_event, Executive, KernelMode, FALSE, NULL );\r
\r
+ /* garbage collector timer is not needed when link is down */\r
+ KeCancelTimer(&p_port->gc_timer);\r
+ KeFlushQueuedDpcs();\r
+\r
/*\r
* Put the QP in the error state. This removes the need to\r
* synchronize with send/receive callbacks.\r
{\r
ipoib_port_t *p_port;\r
ib_api_status_t status;\r
+ LARGE_INTEGER gc_due_time;\r
\r
IPOIB_ENTER( IPOIB_DBG_INIT );\r
\r
- p_port = (ipoib_port_t* __ptr64)p_mcast_rec->mcast_context;\r
+ p_port = (ipoib_port_t*)p_mcast_rec->mcast_context;\r
\r
cl_obj_lock( &p_port->obj );\r
if( p_port->state != IB_QPS_INIT )\r
p_port->p_adapter->params.cm_enabled = FALSE;\r
}\r
}\r
+ /* garbage collector timer is needed when link is active */\r
+ gc_due_time.QuadPart = -(int64_t)(((uint64_t)p_port->p_adapter->params.mc_leave_rescan * 2000000) * 10);\r
+ KeSetTimerEx(&p_port->gc_timer,gc_due_time,\r
+ (LONG)p_port->p_adapter->params.mc_leave_rescan*1000,&p_port->gc_dpc);\r
\r
KeSetEvent( &p_port->sa_event, EVENT_INCREMENT, FALSE );\r
ipoib_port_deref( p_port, ref_join_bcast );\r
{\r
UNUSED_PARAM( p_event_rec );\r
CL_ASSERT( p_event_rec->context );\r
- ((ipoib_port_t* __ptr64)p_event_rec->context)->p_adapter->hung = TRUE;\r
+ ((ipoib_port_t*)p_event_rec->context)->p_adapter->hung = TRUE;\r
}\r
\r
\r
{\r
UNUSED_PARAM( p_event_rec );\r
CL_ASSERT( p_event_rec->context );\r
- ((ipoib_port_t* __ptr64)p_event_rec->context)->p_adapter->hung = TRUE;\r
+ ((ipoib_port_t*)p_event_rec->context)->p_adapter->hung = TRUE;\r
}\r
\r
\r
mcast_req.member_rec.mlid = 0;\r
ib_member_set_state( &mcast_req.member_rec.scope_state,state);\r
\r
- if( mac.addr[0] == 1 && mac.addr[1] == 0 && mac.addr[2] == 0x5E )\r
+ if( (mac.addr[0] == 1) && (mac.addr[2] == 0x5E ))\r
{\r
/*\r
* Update the address portion of the MGID with the 28 lower bits of the\r
- * IP address. Since we're given a MAC address, we end up using only\r
- * the 24 lower bits of that network-byte-ordered value (assuming MSb\r
- * is zero).\r
+ * IP address. Since we're given a MAC address, we are using \r
+ * 24 lower bits of that network-byte-ordered value (assuming MSb\r
+ * is zero) and 4 lsb bits of the first byte of IP address.\r
*/\r
- mcast_req.member_rec.mgid.raw[12] = 0;\r
+ mcast_req.member_rec.mgid.raw[12] = mac.addr[1];\r
mcast_req.member_rec.mgid.raw[13] = mac.addr[3];\r
mcast_req.member_rec.mgid.raw[14] = mac.addr[4];\r
mcast_req.member_rec.mgid.raw[15] = mac.addr[5];\r
mcast_req.retry_cnt = p_port->p_adapter->params.sa_retry_cnt;\r
mcast_req.port_guid = p_port->p_adapter->guids.port_guid.guid;\r
mcast_req.pkey_index = p_port->pkey_index;\r
- mcast_req.member_rec.pkey = p_port->p_adapter->guids.port_guid.pkey;\r
+ mcast_req.member_rec.pkey = cl_hton16(p_port->p_adapter->guids.port_guid.pkey);\r
/*\r
* Create the endpoint and insert it in the port. Since we don't wait for\r
* the mcast SA operations to complete before returning from the multicast\r
\r
IPOIB_ENTER( IPOIB_DBG_MCAST );\r
\r
- p_port = (ipoib_port_t* __ptr64)p_mcast_rec->mcast_context;\r
+ p_port = (ipoib_port_t*)p_mcast_rec->mcast_context;\r
\r
cl_obj_lock( &p_port->obj );\r
if( p_port->state != IB_QPS_RTS )\r
&p_port->endpt_mgr.lid_endpts, p_endpt->dlid, &p_endpt->lid_item );\r
CL_ASSERT( p_qitem == &p_endpt->lid_item );\r
}\r
+ /* set flag that endpoint is use */\r
+ p_endpt->is_in_use = TRUE;\r
cl_obj_unlock( &p_port->obj );\r
\r
/* Try to send all pending sends. */\r
\r
IPOIB_ENTER( IPOIB_DBG_MCAST );\r
\r
- p_port = (ipoib_port_t* __ptr64)context;\r
+ p_port = (ipoib_port_t*)context;\r
\r
IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_MCAST,("p_port->mcast_cnt = %d\n", p_port->mcast_cnt));\r
\r
IPOIB_EXIT( IPOIB_DBG_MCAST );\r
}\r
\r
-\r
-\r
void\r
__leave_error_mcast_cb(\r
IN void *context )\r
\r
IPOIB_ENTER( IPOIB_DBG_MCAST );\r
\r
- p_port = (ipoib_port_t* __ptr64)context;\r
+ p_port = (ipoib_port_t*)context;\r
\r
ipoib_port_deref( p_port, ref_leave_mcast);\r
IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,\r
IPOIB_EXIT( IPOIB_DBG_MCAST );\r
}\r
\r
+static void\r
+__port_do_mcast_garbage(ipoib_port_t* const p_port)\r
+{\r
+ const mac_addr_t DEFAULT_MCAST_GROUP = {0x01, 0x00, 0x5E, 0x00, 0x00, 0x01};\r
+ /* Do garbage collecting... */\r
+\r
+ cl_map_item_t *p_item;\r
+ ipoib_endpt_t *p_endpt;\r
+ cl_qlist_t destroy_mc_list;\r
+ uint8_t cnt;\r
+ const static GC_MAX_LEAVE_NUM = 80;\r
+\r
+ cl_qlist_init( &destroy_mc_list );\r
+\r
+ cl_obj_lock( &p_port->obj );\r
+ cnt = 0;\r
+ p_item = cl_qmap_head( &p_port->endpt_mgr.mac_endpts );\r
+ while( (p_item != cl_qmap_end( &p_port->endpt_mgr.mac_endpts )) && (cnt < GC_MAX_LEAVE_NUM))\r
+ {\r
+ p_endpt = PARENT_STRUCT( p_item, ipoib_endpt_t, mac_item );\r
+ p_item = cl_qmap_next( p_item );\r
+\r
+ /* Check if the current endpoint is not a multicast listener */\r
+\r
+ if( p_endpt->h_mcast && \r
+ (!p_endpt->is_mcast_listener) &&\r
+ ( cl_memcmp( &p_endpt->mac, &DEFAULT_MCAST_GROUP, sizeof(mac_addr_t) ) &&\r
+ (!p_endpt->is_in_use) ))\r
+ {\r
+ cl_qmap_remove_item( &p_port->endpt_mgr.mac_endpts,\r
+ &p_endpt->mac_item );\r
+ cl_fmap_remove_item( &p_port->endpt_mgr.gid_endpts,\r
+ &p_endpt->gid_item );\r
+\r
+ if( p_endpt->dlid )\r
+ {\r
+ cl_qmap_remove_item( &p_port->endpt_mgr.lid_endpts,\r
+ &p_endpt->lid_item );\r
+ p_endpt->dlid = 0;\r
+ }\r
+\r
+ cl_qlist_insert_tail(\r
+ &destroy_mc_list, &p_endpt->mac_item.pool_item.list_item );\r
+ cnt++;\r
+ }\r
+ else\r
+ p_endpt->is_in_use = FALSE;\r
+ }\r
+ cl_obj_unlock( &p_port->obj );\r
+\r
+ /* Destroy all multicast endpoints now that we have released the lock. */\r
+ while( cl_qlist_count( &destroy_mc_list ) )\r
+ {\r
+ p_endpt = PARENT_STRUCT( cl_qlist_head( &destroy_mc_list ),\r
+ ipoib_endpt_t, mac_item.pool_item.list_item );\r
+ IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT,\r
+ ("mcast garbage collector: destroying endpoint %02x:%02x:%02x:%02x:%02x:%02x \n", \r
+ p_endpt->mac.addr[0],\r
+ p_endpt->mac.addr[1],\r
+ p_endpt->mac.addr[2],\r
+ p_endpt->mac.addr[3],\r
+ p_endpt->mac.addr[4],\r
+ p_endpt->mac.addr[5]) );\r
+\r
+ cl_obj_destroy( &PARENT_STRUCT( cl_qlist_remove_head( &destroy_mc_list ),\r
+ ipoib_endpt_t, mac_item.pool_item.list_item )->obj );\r
+ }\r
+}\r
+\r
+static void\r
+__port_mcast_garbage_dpc(KDPC *p_gc_dpc,void *context,void *s_arg1, void *s_arg2)\r
+{\r
+ ipoib_port_t *p_port = context;\r
+\r
+ UNREFERENCED_PARAMETER(p_gc_dpc);\r
+ UNREFERENCED_PARAMETER(s_arg1);\r
+ UNREFERENCED_PARAMETER(s_arg2);\r
+\r
+ __port_do_mcast_garbage(p_port);\r
+}\r
+\r
ipoib_endpt_t*\r
ipoib_endpt_get_by_gid(\r
IN ipoib_port_t* const p_port,\r
#include "ipoib_xfr_mgr.h"\r
#include "ipoib_endpoint.h"\r
\r
+\r
/*\r
* Define to place receive buffer inline in receive descriptor.\r
*/\r
#define IPOIB_INLINE_RECV 0\r
\r
+/* \r
+ * Invalid pkey index\r
+ */\r
+#define PKEY_INVALID_INDEX 0xFFFF\r
+\r
/*\r
* Define to control how transfers are done. When defined as 1, causes\r
* packets to be sent using NDIS DMA facilities (getting the SGL from the\r
ib_recv_wr_t wr;\r
ipoib_endpt_t* p_endpt;\r
ib_local_ds_t local_ds[2];\r
+ NDIS_TCP_IP_CHECKSUM_PACKET_INFO ndis_csum;\r
#if IPOIB_INLINE_RECV\r
recv_buf_t buf;\r
#else\r
\r
atomic32_t hdr_idx;\r
uint16_t pkey_index;\r
+ KDPC gc_dpc;\r
+ KTIMER gc_timer;\r
ipoib_hdr_t hdr[1]; /* Must be last! */\r
\r
} ipoib_port_t;\r
*/\r
#define MAX_BUNDLE_ID_LENGTH 32\r
\r
-\r
-#define IB_MTU 2048\r
+/* MLX4 supports 4K MTU */\r
+#define IB_MTU 4096\r
/*\r
* Header length as defined by IPoIB spec:\r
* http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-04.txt\r
{\r
const uint8_t *p_guid = (const uint8_t*)&port_guid;\r
uint32_t low24;\r
+ net16_t guid_middle;\r
\r
/* Port guid is in network byte order. OUI is in lower 3 bytes. */\r
ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x02 && p_guid[2] == 0xc9 );\r
\r
- if( (port_guid & CL_HTON64( 0x000000ffff000000 )) !=\r
- CL_HTON64(0x0000000200000000))\r
- {\r
+ guid_middle = (net16_t)((port_guid & CL_HTON64( 0x000000ffff000000 )) >>24);\r
+\r
+ if (guid_middle == 2) {\r
+ p_mac_addr->addr[0] = 0;\r
+ } else if (guid_middle == 3) {\r
+ p_mac_addr->addr[0] = 2;\r
+ } else {\r
return IB_INVALID_GUID;\r
}\r
-\r
low24 = ((uint32_t)cl_ntoh64( port_guid ) & 0x00FFFFFF);\r
\r
- p_mac_addr->addr[0] = p_guid[0];\r
p_mac_addr->addr[1] = p_guid[1];\r
p_mac_addr->addr[2] = p_guid[2];\r
p_mac_addr->addr[3] = (uint8_t)(low24 >> 16);\r