[ipoib] Limit the number of retries to connect to broadcast group. (mlnx: 3287)
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 7 Oct 2008 08:07:35 +0000 (08:07 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 7 Oct 2008 08:07:35 +0000 (08:07 +0000)
Part_man.exe – added check for pkey with partial membership. Such a values is not supported in current version.
signed off by: slavas@voltaire.com

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

tools/part_man/user/part_man.c
ulp/ipoib/kernel/ipoib_adapter.h
ulp/ipoib/kernel/ipoib_driver.c
ulp/ipoib/kernel/ipoib_port.c
ulp/ipoib/kernel/ipoib_port.h
ulp/ipoib/kernel/netipoib.inx

index cf39779..5eda787 100644 (file)
@@ -7,6 +7,7 @@
 #include <iba/ib_al.h>\r
 #include "al_dev.h"\r
 \r
+#define IS_FULL_MEMBER_PKEY(pkey)      (0x8000 & (pkey))\r
 \r
 typedef enum\r
 {\r
@@ -195,7 +196,8 @@ static int reg_ibbus_pkey_add(const uint16_t *pkeys, uint16_t pkey_num,OUT pkey_
                }\r
                else\r
                {\r
-                       cnt = strlen(partKey) + sprintf(partKey + strlen(partKey),"%s:",tmp);\r
+                       sprintf(partKey + strlen(partKey),"%s:",tmp);\r
+                       cnt = strlen(partKey);\r
                }\r
        }       \r
 \r
@@ -231,7 +233,7 @@ static int reg_ibbus_pkey_add(const uint16_t *pkeys, uint16_t pkey_num,OUT pkey_
        }\r
        else\r
        {\r
-               printf("No pkey to add\n");\r
+               printf("Required pkeys already exist\n");\r
                retval = 1;\r
        }\r
        RegCloseKey( reg_handle );\r
@@ -532,6 +534,12 @@ int prepare_reg_pkey_input(OUT REQUEST_IN *input,char* cmd[],int num)
                        sscanf(cmd[i],"0x%x",&input->u.guid_pkey.pkeys[input->u.guid_pkey.pkey_num]);\r
                else\r
                        sscanf(cmd[i],"%x",&input->u.guid_pkey.pkeys[input->u.guid_pkey.pkey_num]);\r
+\r
+               if (! IS_FULL_MEMBER_PKEY(input->u.guid_pkey.pkeys[input->u.guid_pkey.pkey_num]))\r
+           {\r
+                       printf("partial member pkey %s is not suported\n",cmd[i]);\r
+                       return 0;\r
+               }\r
                input->u.guid_pkey.pkey_num++;\r
        }\r
        return 1;\r
index a9c022f..84425e9 100644 (file)
@@ -78,6 +78,7 @@ typedef struct _ipoib_params
        mac_addr_t      conf_mac;\r
        uint32_t        mc_leave_rescan;\r
        uint32_t        guid_mask;\r
+       uint32_t        bc_join_retry;\r
 }      ipoib_params_t;\r
 /*\r
 * FIELDS\r
index 0b2b40f..40d5c37 100644 (file)
@@ -162,7 +162,8 @@ IPOIB_REG_ENTRY HCARegTable[] = {
        {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),        2044,       60,   4092},\r
        {NDIS_STRING_CONST("lso"),              0, IPOIB_OFFSET(lso),                   IPOIB_SIZE(lso),                0,          0,      1},\r
-       {NDIS_STRING_CONST("MCLeaveRescan"),    1, IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),    260,        1,    3600}\r
+       {NDIS_STRING_CONST("MCLeaveRescan"),    1, IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),    260,        1,    3600},\r
+       {NDIS_STRING_CONST("BCJoinRetry"),          1, IPOIB_OFFSET(bc_join_retry),                 IPOIB_SIZE(bc_join_retry),      50,         0,    1000}\r
        \r
 };  \r
 \r
index e3be853..ac978c1 100644 (file)
@@ -5681,7 +5681,16 @@ __bcast_cb(
                        CL_ASSERT( p_port->p_adapter->state == IB_PNP_PORT_ADD ||\r
                                p_port->p_adapter->state == IB_PNP_PORT_DOWN ||\r
                                p_port->p_adapter->state == IB_PNP_PORT_INIT );\r
-                       status = __port_get_bcast( p_port );\r
+                       if(++p_port->bc_join_retry_cnt < p_port->p_adapter->params.bc_join_retry)\r
+                       {\r
+                               status = __port_get_bcast( p_port );\r
+                       }\r
+                       else\r
+                       {\r
+                               NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
+                                       EVENT_IPOIB_BCAST_JOIN, 1, p_mcast_rec->status );\r
+                               p_port->bc_join_retry_cnt = 0;\r
+                       }\r
                }\r
                else\r
                {\r
@@ -5701,7 +5710,7 @@ __bcast_cb(
                return;\r
        }\r
        cl_obj_unlock( &p_port->obj );\r
-\r
+       p_port->bc_join_retry_cnt = 0;\r
        status = __endpt_mgr_add_bcast( p_port, p_mcast_rec );\r
        if( status != IB_SUCCESS )\r
        {\r
index 4c8d6a2..46b446a 100644 (file)
@@ -516,6 +516,7 @@ typedef struct _ipoib_port
        uint16_t                                pkey_index;\r
        KDPC                                    gc_dpc;\r
        KTIMER                                  gc_timer;\r
+       uint32_t                                bc_join_retry_cnt;\r
        ipoib_hdr_t                             hdr[1]; /* Must be last! */\r
 \r
 }      ipoib_port_t;\r
index 3539f7a..f288f2a 100644 (file)
@@ -157,6 +157,14 @@ HKR, Ndi\Params\guid_mask,         Optional,       0, "0"
 HKR, Ndi\Params\guid_mask,             Min,            0, "0"\r
 HKR, Ndi\Params\guid_mask,             Max,            0, "252"\r
 \r
+HKR, Ndi\Params\BCJoinRetry,           ParamDesc,      0, "Number of retries connecting to bc"\r
+HKR, Ndi\Params\BCJoinRetry,           Type,           0, "dword"\r
+HKR, Ndi\Params\BCJoinRetry,           Default,        0, "50"\r
+HKR, Ndi\Params\BCJoinRetry,           Optional,       0, "0"\r
+HKR, Ndi\Params\BCJoinRetry,           Min,            0, "0"\r
+HKR, Ndi\Params\BCJoinRetry,           Max,            0, "1000"\r
+\r
+\r
 [IpoibService]\r
 DisplayName     = %IpoibServiceDispName%\r
 ServiceType     = 1 ;%SERVICE_KERNEL_DRIVER%\r