[ofw] partial pkey

Slava Strebkov slavas at voltaire.com
Thu Oct 2 04:05:00 PDT 2008


When IPoiB adapter receives bcast callback form SM with status
IB_REMOTE_ERROR, Adapter enters infinite loop. This hangs the host.
Added counter to prevent this hang.

 

Part_man.exe - added check for pkey with partial membership. Such a
values is not supported in current version.

 

 

Index: tools/part_man/user/part_man.c

===================================================================

--- tools/part_man/user/part_man.c         (revision 1627)

+++ tools/part_man/user/part_man.c       (working copy)

@@ -7,6 +7,7 @@

 #include <iba/ib_al.h>

 #include "al_dev.h"

 

+#define IS_FULL_MEMBER_PKEY(pkey)          (0x8000 & (pkey))

 

 typedef enum

 {

@@ -195,7 +196,8 @@

                        }

                        else

                        {

-                                   cnt = strlen(partKey) +
sprintf(partKey + strlen(partKey),"%s:",tmp);

+                                  sprintf(partKey +
strlen(partKey),"%s:",tmp);

+                                  cnt = strlen(partKey);

                        }

            }           

 

@@ -231,7 +233,7 @@

            }

            else

            {

-                       printf("No pkey to add\n");

+                      printf("Required pkeys already exist\n");

                        retval = 1;

            }

            RegCloseKey( reg_handle );

@@ -532,6 +534,12 @@

 
sscanf(cmd[i],"0x%x",&input->u.guid_pkey.pkeys[input->u.guid_pkey.pkey_n
um]);

                        else

 
sscanf(cmd[i],"%x",&input->u.guid_pkey.pkeys[input->u.guid_pkey.pkey_num
]);

+

+                      if (!
IS_FULL_MEMBER_PKEY(input->u.guid_pkey.pkeys[input->u.guid_pkey.pkey_num
]))

+              {

+                                  printf("partial member pkey %s is not
suported\n",cmd[i]);

+                                  return 0;

+                      }

                        input->u.guid_pkey.pkey_num++;

            }

            return 1;

Index: ulp/ipoib/kernel/ipoib_adapter.h

===================================================================

--- ulp/ipoib/kernel/ipoib_adapter.h          (revision 1627)

+++ ulp/ipoib/kernel/ipoib_adapter.h       (working copy)

@@ -78,6 +78,7 @@

            mac_addr_t       conf_mac;

            uint32_t mc_leave_rescan;

            uint32_t guid_mask;

+          uint32_t bc_join_retry;

 }          ipoib_params_t;

 /*

 * FIELDS

Index: ulp/ipoib/kernel/ipoib_driver.c

===================================================================

--- ulp/ipoib/kernel/ipoib_driver.c (revision 1627)

+++ ulp/ipoib/kernel/ipoib_driver.c          (working copy)

@@ -162,7 +162,8 @@

            {NDIS_STRING_CONST("RecvRatio"),        1,
IPOIB_OFFSET(recv_pool_ratio),       IPOIB_SIZE(recv_pool_ratio),    1,
1,      10},

            {NDIS_STRING_CONST("PayloadMtu"),       1,
IPOIB_OFFSET(payload_mtu),           IPOIB_SIZE(payload_mtu),
2044,       60,   4092},

            {NDIS_STRING_CONST("lso"),              0,
IPOIB_OFFSET(lso),                   IPOIB_SIZE(lso),                0,
0,      1},

-           {NDIS_STRING_CONST("MCLeaveRescan"),    1,
IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),
260,        1,    3600}

+          {NDIS_STRING_CONST("MCLeaveRescan"),    1,
IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),
260,        1,    3600},

+          {NDIS_STRING_CONST("BCJoinRetry"),                1,
IPOIB_OFFSET(bc_join_retry),
IPOIB_SIZE(bc_join_retry),      50,         0,    1000}

            

 };  

 

Index: ulp/ipoib/kernel/ipoib_port.c

===================================================================

--- ulp/ipoib/kernel/ipoib_port.c   (revision 1627)

+++ ulp/ipoib/kernel/ipoib_port.c (working copy)

@@ -5681,7 +5681,16 @@

                                    CL_ASSERT( p_port->p_adapter->state
== IB_PNP_PORT_ADD ||

                                                p_port->p_adapter->state
== IB_PNP_PORT_DOWN ||

                                                p_port->p_adapter->state
== IB_PNP_PORT_INIT );

-                                   status = __port_get_bcast( p_port );

+                                  if(++p_port->bc_join_retry_cnt <
p_port->p_adapter->params.bc_join_retry)

+                                  {

+                                              status =
__port_get_bcast( p_port );

+                                  }

+                                  else

+                                  {

+                                              NdisWriteErrorLogEntry(
p_port->p_adapter->h_adapter,

+
EVENT_IPOIB_BCAST_JOIN, 1, p_mcast_rec->status );

+                                              p_port->bc_join_retry_cnt
= 0;

+                                  }

                        }

                        else

                        {

@@ -5701,7 +5710,7 @@

                        return;

            }

            cl_obj_unlock( &p_port->obj );

-

+          p_port->bc_join_retry_cnt = 0;

            status = __endpt_mgr_add_bcast( p_port, p_mcast_rec );

            if( status != IB_SUCCESS )

            {

Index: ulp/ipoib/kernel/ipoib_port.h

===================================================================

--- ulp/ipoib/kernel/ipoib_port.h   (revision 1627)

+++ ulp/ipoib/kernel/ipoib_port.h (working copy)

@@ -516,6 +516,7 @@

            uint16_t                                     pkey_index;

            KDPC
gc_dpc;

            KTIMER
gc_timer;

+          uint32_t
bc_join_retry_cnt;

            ipoib_hdr_t
hdr[1];  /* Must be last! */

 

 }          ipoib_port_t;

 

Slava 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081002/4610bcb0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: partial_pkey_deny.diff
Type: application/octet-stream
Size: 4006 bytes
Desc: partial_pkey_deny.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081002/4610bcb0/attachment.obj>


More information about the ofw mailing list