[IPoIB] Abort broadcast MC group join if port rate is lower than
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 24 Feb 2006 01:22:47 +0000 (01:22 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 24 Feb 2006 01:22:47 +0000 (01:22 +0000)
existing broadcast group and log an event to the system log.
Also expanded error logging to the system log.

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

ulp/ipoib/kernel/ipoib_log.mc
ulp/ipoib/kernel/ipoib_port.c
ulp/ipoib/kernel/ipoib_port.h

index 7f7c8a8..9676ff2 100644 (file)
@@ -128,3 +128,158 @@ Language=English
 %2: Driver Initialized succesfully.\r
 .\r
 \r
+MessageId=0x0041\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_OPEN_CA\r
+Language=English\r
+%2: Failed to open Channel Adapter.\r
+.\r
+\r
+MessageId=0x0042\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_ALLOC_PD\r
+Language=English\r
+%2: Failed to allocate Protection Domain.\r
+.\r
+\r
+MessageId=0x0043\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_CREATE_RECV_CQ\r
+Language=English\r
+%2: Failed to create receive Completion Queue.\r
+.\r
+\r
+MessageId=0x0044\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_CREATE_SEND_CQ\r
+Language=English\r
+%2: Failed to create send Completion Queue.\r
+.\r
+\r
+MessageId=0x0045\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_CREATE_QP\r
+Language=English\r
+%2: Failed to create Queue Pair.\r
+.\r
+\r
+MessageId=0x0046\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_QUERY_QP\r
+Language=English\r
+%2: Failed to get Queue Pair number.\r
+.\r
+\r
+MessageId=0x0047\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_REG_PHYS\r
+Language=English\r
+%2: Failed to create DMA Memory Region.\r
+.\r
+\r
+MessageId=0x0048\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_RECV_POOL\r
+Language=English\r
+%2: Failed to create receive descriptor pool.\r
+.\r
+\r
+MessageId=0x0049\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_RECV_PKT_POOL\r
+Language=English\r
+%2: Failed to create NDIS_PACKET pool for receive indications.\r
+.\r
+\r
+MessageId=0x004A\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_RECV_BUF_POOL\r
+Language=English\r
+%2: Failed to create NDIS_BUFFER pool for receive indications.\r
+.\r
+\r
+MessageId=0x004B\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_SEND_PKT_POOL\r
+Language=English\r
+%2: Failed to create NDIS_PACKET pool for send processing.\r
+.\r
+\r
+MessageId=0x004C\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_SEND_BUF_POOL\r
+Language=English\r
+%2: Failed to create NDIS_BUFFER pool for send processing.\r
+.\r
+\r
+MessageId=0x004D\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_RECV_PKT_ARRAY\r
+Language=English\r
+%2: Failed to allocate receive indication array.\r
+.\r
+\r
+MessageId=0x004E\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_PORT_INFO_TIMEOUT\r
+Language=English\r
+%2: Subnet Administrator query for port information timed out. \r
+Make sure the SA is functioning properly.  Increasing the number\r
+of retries and retry timeout adapter parameters may solve the\r
+issue.\r
+.\r
+\r
+MessageId=0x004F\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_PORT_INFO_REJECT\r
+Language=English\r
+%2: Subnet Administrator failed the query for port information.\r
+Make sure the SA is functioning properly and compatible.\r
+.\r
+\r
+MessageId=0x0050\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_QUERY_PORT_INFO\r
+Language=English\r
+%2: Subnet Administrator query for port information failed.\r
+.\r
+\r
+MessageId=0x0055\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_BCAST_GET\r
+Language=English\r
+%2: Subnet Administrator failed query for broadcast group information.\r
+.\r
+\r
+MessageId=0x0056\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_BCAST_JOIN\r
+Language=English\r
+%2: Subnet Administrator failed request to joing broadcast group.\r
+.\r
+\r
+MessageId=0x0057\r
+Facility=IPoIB\r
+Severity=Error\r
+SymbolicName=EVENT_IPOIB_BCAST_RATE\r
+Language=English\r
+%2: The local port rate is too slow for the existing broadcast MC group.\r
+.\r
index 756cc9a..54f905c 100644 (file)
@@ -48,7 +48,7 @@
  * request that specifies an MGID.  The ESM returns every McMemberRecord\r
  * instead.\r
  */\r
-#define PR_102801\r
+//#define PR_102801\r
 \r
 \r
 /* Amount of physical memory to register. */\r
@@ -132,6 +132,12 @@ static ib_api_status_t
 __ib_mgr_activate(\r
        IN                              ipoib_port_t* const                     p_port );\r
 \r
+static void\r
+__ib_mgr_set_rate(\r
+       IN                              ipoib_port_t* const                     p_port,\r
+       IN              const   uint8_t                                         link_width,\r
+       IN              const   uint8_t                                         link_speed );\r
+\r
 /******************************************************************************\r
 *\r
 * Buffer manager operations.\r
@@ -747,6 +753,8 @@ __ib_mgr_init(
                NULL, p_port, &p_port->ib_mgr.h_ca );\r
        if( status != IB_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_OPEN_CA, 1, status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("ib_open_ca returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
@@ -758,6 +766,8 @@ __ib_mgr_init(
                p_port->ib_mgr.h_ca, IB_PDT_UD, p_port, &p_port->ib_mgr.h_pd );\r
        if( status != IB_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_ALLOC_PD, 1, status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("ib_alloc_pd returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
@@ -774,6 +784,8 @@ __ib_mgr_init(
                __cq_event, &p_port->ib_mgr.h_recv_cq );\r
        if( status != IB_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_CREATE_RECV_CQ, 1, status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("ib_create_cq returned %s.\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
@@ -789,6 +801,8 @@ __ib_mgr_init(
                __cq_event, &p_port->ib_mgr.h_send_cq );\r
        if( status != IB_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_CREATE_SEND_CQ, 1, status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("ib_create_cq returned %s.\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
@@ -811,6 +825,8 @@ __ib_mgr_init(
                __qp_event, &p_port->ib_mgr.h_qp );\r
        if( status != IB_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_CREATE_QP, 1, status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("ib_create_qp returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
@@ -821,6 +837,8 @@ __ib_mgr_init(
                p_port->ib_mgr.h_qp, &qp_attr );\r
        if( status != IB_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_QUERY_QP, 1, status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("ib_query_qp returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
@@ -843,6 +861,8 @@ __ib_mgr_init(
                &p_port->ib_mgr.lkey, &rkey, &p_port->ib_mgr.h_mr );\r
        if( status != IB_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_REG_PHYS, 1, status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("ib_reg_phys returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
@@ -926,6 +946,8 @@ __buf_mgr_init(
 #endif /* IPOIB_INLINE_RECV */\r
        if( cl_status != CL_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_RECV_POOL, 1, cl_status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("cl_qpool_init for recvs returned %s\n",\r
                        cl_status_text[cl_status]) );\r
@@ -937,6 +959,8 @@ __buf_mgr_init(
                p_params->rq_depth, PROTOCOL_RESERVED_SIZE_IN_PACKET );\r
        if( ndis_status != NDIS_STATUS_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_RECV_PKT_POOL, 1, ndis_status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("NdisAllocatePacketPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
@@ -946,6 +970,8 @@ __buf_mgr_init(
                p_params->rq_depth );\r
        if( ndis_status != NDIS_STATUS_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_RECV_BUF_POOL, 1, ndis_status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("NdisAllocateBufferPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
@@ -956,6 +982,8 @@ __buf_mgr_init(
                1, PROTOCOL_RESERVED_SIZE_IN_PACKET );\r
        if( ndis_status != NDIS_STATUS_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_SEND_PKT_POOL, 1, ndis_status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("NdisAllocatePacketPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
@@ -965,6 +993,8 @@ __buf_mgr_init(
                &p_port->buf_mgr.h_send_buf_pool, 1 );\r
        if( ndis_status != NDIS_STATUS_SUCCESS )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_SEND_BUF_POOL, 1, ndis_status );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("NdisAllocateBufferPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
@@ -1249,6 +1279,8 @@ __recv_mgr_init(
                sizeof(NDIS_PACKET*) * p_port->p_adapter->params.rq_depth );\r
        if( !p_port->recv_mgr.recv_pkt_array )\r
        {\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_RECV_PKT_ARRAY, 0 );\r
                IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
                        ("cl_malloc for PNDIS_PACKET array failed.\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
@@ -4436,7 +4468,7 @@ __port_info_cb(
                                ("Received port info: link width = %d.\n",\r
                                p_port_rec->port_info.link_width_active) );\r
 \r
-                       ipoib_set_rate( p_port->p_adapter,\r
+                       __ib_mgr_set_rate( p_port,\r
                                p_port_rec->port_info.link_width_active,\r
                                ib_port_info_get_link_speed_active( &p_port_rec->port_info ) );\r
 \r
@@ -4455,9 +4487,22 @@ __port_info_cb(
                        ("Instance destroying - Aborting.\n") );\r
                break;\r
 \r
+       case IB_TIMEOUT:\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_PORT_INFO_TIMEOUT, 0 );\r
+               IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query timed out.\n") );\r
+               break;\r
+\r
+       case IB_REMOTE_ERROR:\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_PORT_INFO_REJECT, 0 );\r
+               IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query rejected by SA.\n") );\r
+               break;\r
+\r
        default:\r
-               /* Flag the adapter as hung. */\r
-               p_port->p_adapter->hung = TRUE;\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_QUERY_PORT_INFO, 1, p_query_rec->status );\r
+               /* Hopefully we'll get an SM change event that will restart things. */\r
                IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query failed.\n") );\r
        }\r
 \r
@@ -4483,7 +4528,7 @@ __port_get_mcast(
 \r
        IPOIB_ENTER( IPOIB_DBG_MCAST );\r
 \r
-       info.method = IB_MAD_METHOD_GETTABLE;\r
+       info.method = IB_MAD_METHOD_GET;\r
        info.attr_id = IB_MAD_ATTR_MCMEMBER_RECORD;\r
        info.attr_size = sizeof(ib_member_rec_t);\r
        info.comp_mask = IB_MCR_COMPMASK_MGID;\r
@@ -4583,6 +4628,8 @@ __bcast_get_cb(
                IPOIB_TRACE( IPOIB_DBG_INIT, ("Instance destroying - Aborting.\n") );\r
        \r
        default:\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_BCAST_GET, 1, p_query_rec->status );\r
                /* Flag the adapter as hung. */\r
                p_port->p_adapter->hung = TRUE;\r
        }\r
@@ -4608,6 +4655,22 @@ __port_join_bcast(
 \r
        IPOIB_ENTER( IPOIB_DBG_MCAST );\r
 \r
+       /* Check that the rate is realizable for our port. */\r
+       if( p_port->ib_mgr.rate < (p_member_rec->rate & 0x3F) )\r
+       {\r
+               /*\r
+                * The MC group rate is higher than our port's rate.  Log an error\r
+                * and stop.  A port transition will drive the retry.\r
+                */\r
+               IPOIB_TRACE( IPOIB_DBG_WARN,\r
+                       ("Unrealizable join due to rate mismatch.\n") );\r
+               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                       EVENT_IPOIB_BCAST_RATE, 2,\r
+                       (uint32_t)(p_member_rec->rate & 0x3F),\r
+                       (uint32_t)p_port->ib_mgr.rate );\r
+               return;\r
+       }\r
+\r
        /* Join the broadcast group. */\r
        cl_memclr( &mcast_req, sizeof(mcast_req) );\r
        /* Copy the results of the Get to use as parameters. */\r
@@ -4729,7 +4792,7 @@ ipoib_port_down(
        p_port->state = IB_QPS_ERROR;\r
 \r
        NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
-               EVENT_IPOIB_PORT_DOWN, 0);\r
+               EVENT_IPOIB_PORT_DOWN, 0 );\r
 \r
        if( p_port->ib_mgr.h_query )\r
        {\r
@@ -4810,6 +4873,8 @@ __bcast_cb(
                }\r
                else\r
                {\r
+                       NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                               EVENT_IPOIB_BCAST_JOIN, 1, p_mcast_rec->status );\r
                        /* Flag the adapter as hung. */\r
                        p_port->p_adapter->hung = TRUE;\r
                }\r
@@ -4943,6 +5008,60 @@ __ib_mgr_activate(
        return IB_SUCCESS;\r
 }\r
 \r
+static void\r
+__ib_mgr_set_rate(\r
+       IN                              ipoib_port_t* const                     p_port,\r
+       IN              const   uint8_t                                         link_width,\r
+       IN              const   uint8_t                                         link_speed )\r
+{\r
+       IPOIB_ENTER( IPOIB_DBG_INIT );\r
+\r
+       /* Set the link speed based on the IB link speed (1x vs 4x, etc). */\r
+       switch( link_width * link_width * link_speed )\r
+       {\r
+       case 1:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_2_5_GBS;\r
+               break;\r
+\r
+       case 2:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_5_GBS;\r
+               break;\r
+\r
+       case 4:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_10_GBS;\r
+               break;\r
+\r
+       case 8:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_20_GBS;\r
+               break;\r
+\r
+       case 16:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_40_GBS;\r
+               break;\r
+\r
+       case 64:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_30_GBS;\r
+               break;\r
+\r
+       case 128:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_60_GBS;\r
+               break;\r
+\r
+       case 256:\r
+               p_port->ib_mgr.rate = IB_PATH_RECORD_RATE_120_GBS;\r
+               break;\r
+\r
+       default:\r
+               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                       ("Invalid link rate (%d).\n", link_width) );\r
+               p_port->ib_mgr.rate = 0;\r
+       }\r
+\r
+       ipoib_set_rate( p_port->p_adapter, link_width, link_speed );\r
+\r
+       IPOIB_EXIT( IPOIB_DBG_INIT );\r
+}\r
+\r
 \r
 /* Transition to a passive level thread. */\r
 ib_api_status_t\r
index 8d78ce6..c9c8cc4 100644 (file)
@@ -90,6 +90,7 @@ typedef struct _ipoib_ib_mgr
        ib_mr_handle_t                  h_mr;\r
        net32_t                                 lkey;\r
 \r
+       uint8_t                                 rate;\r
        ib_member_rec_t                 bcast_rec;\r
 \r
 }      ipoib_ib_mgr_t;\r