[Openib-windows] FW: [PATCH] client reregister

Yossi Leybovich sleybo at mellanox.co.il
Mon Sep 12 10:19:36 PDT 2005


Fab

Attach is patch for supporting client reregister event in the HCA , PnP
manager and in the IPoIB I followed your recommendation to implement
reregistration just in the level of IPoIB till you will have the full design
to the mcast/service_record mngr in the AL

Main changes:

1. for the HCA async event I add the support to parse the event, but I
didn't have the chance to check that it actually work 
(I encounter problem to get async events from the HCA  , I don't get the cq
async events as well. I will debug that later thus week) The code just add
defines and cases and I think t safe to add it.

2. In PnP manager I trapped the port_info and set flag to signal that client
reregister was set by the SM .

3. In the IPoIB after getting the PNP_CLIENT_REREGISTER event I remove the
bcast entry and issue get_bcast again. After the IpoIB join the bcast group
it register the IP address and refresh the mcast array (as it do in the
PNP_ACTIVE). Of course that wont be needed after we will implement the
mcast/service_records reregistration mngr in the AL (BTW did you find the
time to put some initial design draft)

4. few cosmetics changes in the TRACES and the functions name. 

Pls review and send me your comments.

10x
Yossi



Singned-off-by:Yossi Leybovich (sleybo at mellanox.co.il)
Index: core/al/al_ci_ca_shared.c
===================================================================
--- core/al/al_ci_ca_shared.c	(revision 355)
+++ core/al/al_ci_ca_shared.c	(working copy)
@@ -371,6 +371,7 @@
 {
 	ib_ca_handle_t			h_ca;
 
+	AL_ENTER(AL_DBG_CA);
 	CL_ASSERT( p_event_rec );
 	h_ca = p_event_rec->handle.h_ca;
 
@@ -379,6 +380,8 @@
 
 	if( h_ca->pfn_event_cb )
 		h_ca->pfn_event_cb( p_event_rec );
+
+	AL_EXIT(AL_DBG_CA);
 }
 
 
Index: core/al/al_init.c
===================================================================
--- core/al/al_init.c	(revision 355)
+++ core/al/al_init.c	(working copy)
@@ -39,7 +39,7 @@
 
 
 
-uint32_t				g_al_dbg_lvl = AL_DBG_ERROR;
+uint32_t				g_al_dbg_lvl = AL_DBG_ERROR |
AL_DBG_SMI;
 
 
 /*
Index: core/al/kernel/al_pnp.c
===================================================================
--- core/al/kernel/al_pnp.c	(revision 355)
+++ core/al/kernel/al_pnp.c	(working copy)
@@ -465,6 +465,7 @@
 	case IB_PNP_PORT_DOWN:
 	case IB_PNP_PKEY_CHANGE:
 	case IB_PNP_SM_CHANGE:
+	case IB_PNP_CLIENT_REREGISTER:
 	case IB_PNP_GID_CHANGE:
 	case IB_PNP_LID_CHANGE:
 	case IB_PNP_SUBNET_TIMEOUT_CHANGE:
@@ -1409,6 +1410,7 @@
 			event_rec.pnp_event = IB_PNP_SM_CHANGE;
 			__pnp_process_port_forward( &event_rec );
 		}
+
 		/* Check for subnet timeout change. */
 		if( p_old_port_attr->subnet_timeout !=
 			p_new_port_attr->subnet_timeout )
@@ -1416,6 +1418,12 @@
 			event_rec.pnp_event = IB_PNP_SUBNET_TIMEOUT_CHANGE;
 			__pnp_process_port_forward( &event_rec );
 		}
+		if( p_old_port_attr->client_reregistration )
+		{
+			event_rec.pnp_event = IB_PNP_CLIENT_REREGISTER;
+			__pnp_process_port_forward( &event_rec );
+		}
+
 	}
 }
 
@@ -1465,7 +1473,7 @@
 	ib_ca_attr_t			*p_old_ca_attr;
 	ib_api_status_t			status;
 
-	CL_ENTER( AL_DBG_PNP, g_al_dbg_lvl );
+	AL_ENTER( AL_DBG_PNP);
 
 	UNUSED_PARAM( p_item );
 	CL_ASSERT( gp_pnp );
@@ -1510,7 +1518,7 @@
 	deref_al_obj( &gp_pnp->obj );
 	gp_pnp->async_item_is_busy = FALSE;
 
-	CL_EXIT( AL_DBG_PNP, g_al_dbg_lvl );
+	AL_EXIT( AL_DBG_PNP);
 }
 
 
Index: core/al/kernel/al_smi.c
===================================================================
--- core/al/kernel/al_smi.c	(revision 355)
+++ core/al/kernel/al_smi.c	(working copy)
@@ -1810,8 +1810,14 @@
 
 			if( p_port_info )
 			{
+			
 				p_spl_qp_svc->base_lid =
p_port_info->base_lid;
 				p_spl_qp_svc->lmc = ib_port_info_get_lmc(
p_port_info );
+				if (p_port_info->subnet_timeout & 0x80)
+				{
+					AL_TRACE(AL_DBG_PNP,(" setting the
client reregister event \n"));
+
p_spl_qp_svc->obj.p_ci_ca->p_pnp_attr->p_port_attr->client_reregistration =
1;
+				}
 			}
 		}
 	}
Index: hw/mt23108/kernel/hca_data.c
===================================================================
--- hw/mt23108/kernel/hca_data.c	(revision 355)
+++ hw/mt23108/kernel/hca_data.c	(working copy)
@@ -693,6 +693,10 @@
 		if (event_class_p) *event_class_p = E_EV_CA;
 		return IB_AE_PORT_ACTIVE; /* ACTIVE STATE */
 
+	case VAPI_CLIENT_REREGISTER:
+		if (event_class_p) *event_class_p = E_EV_CA;
+		return IB_AE_CLIENT_REREGISTER; /* ACTIVE STATE */
+
 	default:
 		CL_TRACE(MLNX_DBG_INFO, g_mlnx_dbg_lvl, ("FAIL to map %d
(last known %d) returning %d\n",
 			event_id, VAPI_PORT_ACTIVE, IB_AE_LOCAL_FATAL));
@@ -2046,6 +2050,8 @@
 		ibal_port_cap_p->sm_disable = TRUE;
 	if (vapi_port_cap & IB_CAP_MASK_IS_SM)
 		ibal_port_cap_p->sm = TRUE;
+	if (vapi_port_cap & IB_CAP_MASK_IS_CLIENT_REREGISTRATION_SUP)
+		ibal_port_cap_p->client_reregister= TRUE;
 }
 
 /////////////////////////////////////////////////////////
Index: hw/mt23108/kernel/hca_verbs.c
===================================================================
--- hw/mt23108/kernel/hca_verbs.c	(revision 355)
+++ hw/mt23108/kernel/hca_verbs.c	(working copy)
@@ -414,6 +414,10 @@
 		hca_attr_mask |= HCA_ATTR_IS_VENDOR_CLS_SUP;
 		hca_attr.is_vendor_cls_sup = (MT_bool)p_port_attr->cap.vend;
 	}
+	if (modca_cmd & IB_CA_MOD_IS_CLIENT_REREGISTER_SUPPORTED) {
+		hca_attr_mask |= HCA_ATTR_IS_CLIENT_REREGISTRATION_SUP;
+		hca_attr.is_client_reregister_sup=
(MT_bool)p_port_attr->cap.client_reregister;
+	}
 	if (modca_cmd & IB_CA_MOD_QKEY_CTR) {
 		if (p_port_attr->qkey_ctr == 0)
 			hca_attr.reset_qkey_counter = TRUE;
Index: hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c
===================================================================
--- hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c	(revision 355)
+++ hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c	(working copy)
@@ -2732,6 +2732,13 @@
               IB_CAP_MASK_CLR(capabilities, IB_CAP_MASK_IS_VENDOR_CLS_SUP);
           }
       }
+     if(HCA_ATTR_IS_SET(*hca_attr_mask_p,
HCA_ATTR_IS_CLIENT_REREGISTRATION_SUP) ) {
+          if (hca_attr_p->is_client_reregister_sup) {
+              IB_CAP_MASK_SET(capabilities,
IB_CAP_MASK_IS_CLIENT_REREGISTRATION_SUP);
+          } else {
+              IB_CAP_MASK_CLR(capabilities,
IB_CAP_MASK_IS_CLIENT_REREGISTRATION_SUP);
+          }
+      }	  
   }
 
   set_ib_props.capability_mask = capabilities;
Index: hw/mt23108/vapi/Hca/verbs/common/vapi_common.c
===================================================================
--- hw/mt23108/vapi/Hca/verbs/common/vapi_common.c	(revision 355)
+++ hw/mt23108/vapi/Hca/verbs/common/vapi_common.c	(working copy)
@@ -146,6 +146,7 @@
   SAFE_APPEND(HCA_ATTR_IS_SNMP_TUN_SUP)
   SAFE_APPEND(HCA_ATTR_IS_DEV_MGT_SUP)
   SAFE_APPEND(HCA_ATTR_IS_VENDOR_CLS_SUP)
+   SAFE_APPEND(HCA_ATTR_IS_CLIENT_REREGISTRATION_SUP)
   SAFE_APPEND(HCA_ATTR_MAX)
   end_mask_sym(buf, cbuf, bufsz);
   return buf;
Index: hw/mt23108/vapi/Hca/verbs/vapi_types.h
===================================================================
--- hw/mt23108/vapi/Hca/verbs/vapi_types.h	(revision 355)
+++ hw/mt23108/vapi/Hca/verbs/vapi_types.h	(working copy)
@@ -111,7 +111,8 @@
   HCA_ATTR_IS_SNMP_TUN_SUP    = 2,
   HCA_ATTR_IS_DEV_MGT_SUP     = 4,
   HCA_ATTR_IS_VENDOR_CLS_SUP  = 8,
-  HCA_ATTR_MAX                = 16 /*Dummy enum entry: always keep it the
last one */
+  HCA_ATTR_IS_CLIENT_REREGISTRATION_SUP  = 16,
+  HCA_ATTR_MAX                = 32 /*Dummy enum entry: always keep it the
last one */
 } VAPI_hca_attr_mask_enum_t;
 
 
@@ -126,7 +127,8 @@
         HCA_ATTR_IS_SM|\
         HCA_ATTR_IS_SNMP_TUN_SUP|\
         HCA_ATTR_IS_DEV_MGT_SUP|\
-        HCA_ATTR_IS_VENDOR_CLS_SUP))!=0)
+        HCA_ATTR_IS_VENDOR_CLS_SUP|\
+        HCA_ATTR_IS_CLIENT_REREGISTRATION_SUP))!=0)
 #define HCA_ATTR_IS_SET(mask,attr)    (((mask)&(attr))!=0)
 
 /* QP attributes mask enumeration */
@@ -385,7 +387,8 @@
   VAPI_LOCAL_EEC_CATASTROPHIC_ERROR, /*EEC*/
   VAPI_LOCAL_CATASTROPHIC_ERROR,     /*none*/
   VAPI_PORT_ERROR,                   /*PORT*/
-  VAPI_PORT_ACTIVE                   /*PORT*/
+  VAPI_PORT_ACTIVE,                   /*PORT*/
+  VAPI_CLIENT_REREGISTER
 } VAPI_event_record_type_t;
 
 
@@ -586,6 +589,7 @@
   MT_bool      is_snmp_tun_sup;
   MT_bool      is_dev_mgt_sup;
   MT_bool      is_vendor_cls_sup;
+  MT_bool      is_client_reregister_sup;
 } VAPI_hca_attr_t;  
 
 
Index: hw/mt23108/vapi/mlxsys/mtl_types/ib_defs.h
===================================================================
--- hw/mt23108/vapi/mlxsys/mtl_types/ib_defs.h	(revision 355)
+++ hw/mt23108/vapi/mlxsys/mtl_types/ib_defs.h	(working copy)
@@ -187,8 +187,11 @@
 /*20: */  IB_CAP_MASK_IS_VENDOR_CLS_SUP   = (1<<20),
 /*21: */  IB_CAP_MASK_IS_DR_NOTICE_SUP    = (1<<21),
 /*22: */  IB_CAP_MASK_IS_CAP_MASK_NOTICE_SUP = (1<<22),
-/*23: */  IB_CAP_MASK_IS_BOOT_MGMT_SUP    = (1<<23)
-/*24 - 31: RESERVED */
+/*23: */  IB_CAP_MASK_IS_BOOT_MGMT_SUP    = (1<<23),
+/*24: */  IB_CAP_MASK_IS_LINK_ROUND_TRIP_LATENCY_SUP    = (1<<24), //????
NEW
+/*25: */  IB_CAP_MASK_IS_CLIENT_REREGISTRATION_SUP    = (1<<25)
+/*26 - 31: RESERVED */
+
 } IB_capability_mask_bits_t;
 
 
Index: inc/iba/ib_al.h
===================================================================
--- inc/iba/ib_al.h	(revision 355)
+++ inc/iba/ib_al.h	(working copy)
@@ -8076,7 +8076,8 @@
 #define IB_PNP_EVENT_SM					0x00100000
 #define IB_PNP_EVENT_GID				0x00200000
 #define IB_PNP_EVENT_LID				0x00400000
-#define IB_PNP_EVENT_SUBNET				0x00800000
+#define IB_PNP_EVENT_SUBNET			0x00800000
+#define IB_PNP_EVENT_CLIENT_REREGISTER	0x01000000
 
 #define IB_PNP_CA_ADD					(IB_PNP_CA |
IB_PNP_EVENT_ADD)
 #define IB_PNP_CA_REMOVE				(IB_PNP_CA |
IB_PNP_EVENT_REMOVE)
@@ -8089,6 +8090,7 @@
 #define IB_PNP_PORT_DOWN				(IB_PNP_PORT |
IB_PNP_EVENT_DOWN)
 #define IB_PNP_PKEY_CHANGE				(IB_PNP_PORT |
IB_PNP_EVENT_PKEY)
 #define IB_PNP_SM_CHANGE				(IB_PNP_PORT |
IB_PNP_EVENT_SM)
+#define IB_PNP_CLIENT_REREGISTER		(IB_PNP_PORT |
IB_PNP_EVENT_CLIENT_REREGISTER)
 #define IB_PNP_GID_CHANGE				(IB_PNP_PORT |
IB_PNP_EVENT_GID)
 #define IB_PNP_LID_CHANGE				(IB_PNP_PORT |
IB_PNP_EVENT_LID)
 #define IB_PNP_SUBNET_TIMEOUT_CHANGE	(IB_PNP_PORT | IB_PNP_EVENT_SUBNET)
Index: inc/iba/ib_types.h
===================================================================
--- inc/iba/ib_types.h	(revision 355)
+++ inc/iba/ib_types.h	(working copy)
@@ -3839,38 +3839,38 @@
 #define IB_PORT_LINK_SPEED_SUPPORTED_MASK			0xF0
 
 
-#define IB_PORT_CAP_RESV1			(CL_NTOH32(0x00000001))
-#define IB_PORT_CAP_IS_SM			(CL_NTOH32(0x00000002))
-#define IB_PORT_CAP_HAS_NOTICE		(CL_NTOH32(0x00000004))
-#define IB_PORT_CAP_HAS_TRAP		(CL_NTOH32(0x00000008))
-#define IB_PORT_CAP_RESV2			(CL_NTOH32(0x00000010))
-#define IB_PORT_CAP_HAS_AUTO_MIG	(CL_NTOH32(0x00000020))
-#define IB_PORT_CAP_HAS_SL_MAP		(CL_NTOH32(0x00000040))
-#define IB_PORT_CAP_HAS_NV_MKEY		(CL_NTOH32(0x00000080))
-#define IB_PORT_CAP_HAS_NV_PKEY		(CL_NTOH32(0x00000100))
-#define IB_PORT_CAP_HAS_LED_INFO	(CL_NTOH32(0x00000200))
-#define IB_PORT_CAP_SM_DISAB		(CL_NTOH32(0x00000400))
-#define IB_PORT_CAP_RESV3			(CL_NTOH32(0x00000800))
-#define IB_PORT_CAP_RESV4			(CL_NTOH32(0x00001000))
-#define IB_PORT_CAP_RESV5			(CL_NTOH32(0x00002000))
-#define IB_PORT_CAP_RESV6			(CL_NTOH32(0x00004000))
-#define IB_PORT_CAP_RESV7			(CL_NTOH32(0x00008000))
-#define IB_PORT_CAP_HAS_COM_MGT		(CL_NTOH32(0x00010000))
-#define IB_PORT_CAP_HAS_SNMP		(CL_NTOH32(0x00020000))
-#define IB_PORT_CAP_RESV8			(CL_NTOH32(0x00040000))
-#define IB_PORT_CAP_HAS_DEV_MGT		(CL_NTOH32(0x00080000))
-#define IB_PORT_CAP_HAS_VEND_CLS	(CL_NTOH32(0x00100000))
-#define IB_PORT_CAP_HAS_DR_NTC		(CL_NTOH32(0x00200000))
-#define IB_PORT_CAP_HAS_CAP_NTC		(CL_NTOH32(0x00400000))
-#define IB_PORT_CAP_HAS_BM			(CL_NTOH32(0x00800000))
-#define IB_PORT_CAP_RESV9			(CL_NTOH32(0x01000000))
-#define IB_PORT_CAP_RESV10			(CL_NTOH32(0x02000000))
-#define IB_PORT_CAP_RESV11			(CL_NTOH32(0x04000000))
-#define IB_PORT_CAP_RESV12			(CL_NTOH32(0x08000000))
-#define IB_PORT_CAP_RESV13			(CL_NTOH32(0x10000000))
-#define IB_PORT_CAP_RESV14			(CL_NTOH32(0x20000000))
-#define IB_PORT_CAP_RESV15			(CL_NTOH32(0x40000000))
-#define IB_PORT_CAP_RESV16			(CL_NTOH32(0x80000000))
+#define IB_PORT_CAP_RESV0         (CL_NTOH32(0x00000001))
+#define IB_PORT_CAP_IS_SM         (CL_NTOH32(0x00000002))
+#define IB_PORT_CAP_HAS_NOTICE    (CL_NTOH32(0x00000004))
+#define IB_PORT_CAP_HAS_TRAP      (CL_NTOH32(0x00000008))
+#define IB_PORT_CAP_HAS_IPD       (CL_NTOH32(0x00000010))
+#define IB_PORT_CAP_HAS_AUTO_MIG  (CL_NTOH32(0x00000020))
+#define IB_PORT_CAP_HAS_SL_MAP    (CL_NTOH32(0x00000040))
+#define IB_PORT_CAP_HAS_NV_MKEY   (CL_NTOH32(0x00000080))
+#define IB_PORT_CAP_HAS_NV_PKEY   (CL_NTOH32(0x00000100))
+#define IB_PORT_CAP_HAS_LED_INFO  (CL_NTOH32(0x00000200))
+#define IB_PORT_CAP_SM_DISAB      (CL_NTOH32(0x00000400))
+#define IB_PORT_CAP_HAS_SYS_GUID  (CL_NTOH32(0x00000800)) #define 
+IB_PORT_CAP_HAS_PKEY_SW_EXT_PORT_TRAP (CL_NTOH32(0x00001000))
+#define IB_PORT_CAP_RESV13        (CL_NTOH32(0x00002000))
+#define IB_PORT_CAP_RESV14        (CL_NTOH32(0x00004000))
+#define IB_PORT_CAP_RESV15        (CL_NTOH32(0x00008000))
+#define IB_PORT_CAP_HAS_COM_MGT   (CL_NTOH32(0x00010000))
+#define IB_PORT_CAP_HAS_SNMP      (CL_NTOH32(0x00020000))
+#define IB_PORT_CAP_HAS_REINIT    (CL_NTOH32(0x00040000))
+#define IB_PORT_CAP_HAS_DEV_MGT   (CL_NTOH32(0x00080000))
+#define IB_PORT_CAP_HAS_VEND_CLS  (CL_NTOH32(0x00100000))
+#define IB_PORT_CAP_HAS_DR_NTC    (CL_NTOH32(0x00200000))
+#define IB_PORT_CAP_HAS_CAP_NTC   (CL_NTOH32(0x00400000))
+#define IB_PORT_CAP_HAS_BM        (CL_NTOH32(0x00800000))
+#define IB_PORT_CAP_HAS_LINK_TRIP (CL_NTOH32(0x01000000)) #define 
+IB_PORT_CAP_HAS_CLI_REREG (CL_NTOH32(0x02000000))
+#define IB_PORT_CAP_RESV26        (CL_NTOH32(0x04000000))
+#define IB_PORT_CAP_RESV27        (CL_NTOH32(0x08000000))
+#define IB_PORT_CAP_RESV28        (CL_NTOH32(0x10000000))
+#define IB_PORT_CAP_RESV29        (CL_NTOH32(0x20000000))
+#define IB_PORT_CAP_RESV30        (CL_NTOH32(0x40000000))
+#define IB_PORT_CAP_RESV31        (CL_NTOH32(0x80000000))
 
 /****f* IBA Base: Types/ib_port_info_get_port_state
 * NAME
@@ -7177,6 +7177,7 @@
 	IB_AE_WQ_ACCESS_ERROR,
 	IB_AE_PORT_ACTIVE,
 	IB_AE_PORT_DOWN,
+	IB_AE_CLIENT_REREGISTER,
 	IB_AE_UNKNOWN		/* ALWAYS LAST ENUM VALUE */
 
 }	ib_async_event_t;
@@ -7266,6 +7267,9 @@
 *		The link is declared unavailable: IB_LINK_INIT,
IB_LINK_ARMED,
 *		IB_LINK_DOWN.
 *
+*	IB_AE_CLIENT_REREGISTER
+*		The SM idicate to client to reregister its SA records.
+*
 *	IB_AE_UNKNOWN
 *		An unknown error occurred which cannot be attributed to any
 *		resource; behavior is indeterminate.
@@ -7429,7 +7433,11 @@
 	boolean_t		reinit;
 	boolean_t		ledinfo;
 	boolean_t		port_active;
-
+	boolean_t		ipd;
+	boolean_t		pkey_switch_ext_port;
+	boolean_t		bm;
+	boolean_t		link_rtl;
+	boolean_t		client_reregister;
 }	ib_port_cap_t;
 /*****/
 
@@ -7521,7 +7529,7 @@
 	 * timeout = 4.096 microseconds * 2^subnet_timeout
 	 */
 	uint8_t					subnet_timeout;
-
+	uint8_t					client_reregistration;
 	ib_port_cap_t			cap;
 	uint16_t				pkey_ctr;
 	uint16_t				qkey_ctr;
@@ -9201,6 +9209,7 @@
 #define IB_CA_MOD_SHUTDOWN_PORT				0x00100000
 #define IB_CA_MOD_INIT_TYPE_VALUE			0x00200000
 #define IB_CA_MOD_SYSTEM_IMAGE_GUID			0x00400000
+#define IB_CA_MOD_IS_CLIENT_REREGISTER_SUPPORTED 	0x00800000
 /*
 * VALUES
 *	IB_CA_MOD_IS_CM_SUPPORTED
@@ -9279,6 +9288,10 @@
 *
 *	IB_CA_MOD_SYSTEM_IMAGE_GUID
 *		Used to modify the system image GUID for the port.
+*
+*	IB_CA_MOD_IS_CLIENT_REREGISTER_SUPPORTED
+*		Used to modify the system image GUID for the port.
+*
 *****/
 
 
Index: ulp/ipoib/kernel/ipoib_adapter.c
===================================================================
--- ulp/ipoib/kernel/ipoib_adapter.c	(revision 355)
+++ ulp/ipoib/kernel/ipoib_adapter.c	(working copy)
@@ -500,6 +500,7 @@
 		return IB_NOT_DONE;
 	}
 
+	IPOIB_TRACE(IPOIB_DBG_INFO,("p_pnp_rec->pnp_event = 
+0x%x\n",p_pnp_rec->pnp_event));
 	switch( p_pnp_rec->pnp_event )
 	{
 	case IB_PNP_PORT_ADD:
@@ -614,7 +615,27 @@
 		IPOIB_TRACE( IPOIB_DBG_INFO,
 			("IPOIB: Received unhandled PnP event %d\n",
 			p_pnp_rec->pnp_event) );
+		status = IB_SUCCESS;
+		break;
+		
+	case IB_PNP_CLIENT_REREGISTER:
+		/* Join multicast groups and put QP in RTS. */
+		CL_ASSERT( p_pnp_rec->context );
+		cl_obj_lock( &p_adapter->obj );
+		p_adapter->state = IB_PNP_CLIENT_REREGISTER;
+		cl_obj_unlock( &p_adapter->obj );
+		IPOIB_TRACE( IPOIB_DBG_INFO,
+			("IPOIB: Received client reregister PnP event %d\n",
+			p_pnp_rec->pnp_event) );
+
+		ipoib_port_client_reregister( p_adapter->p_port);
+
+		status = IB_SUCCESS;
+		
 	default:
+		IPOIB_TRACE( IPOIB_DBG_INFO,
+			("IPOIB: Received unhandled PnP event 0x%x\n",
+			p_pnp_rec->pnp_event) );
 		status = IB_SUCCESS;
 		break;
 	}
@@ -855,7 +876,20 @@
 	case IB_PNP_PORT_REMOVE:
 		ipoib_resume_oids( p_adapter );
 		break;
+	case IB_PNP_CLIENT_REREGISTER:
 
+		/* Join all programmed multicast groups. */
+		ipoib_refresh_mcast(p_adapter, p_adapter->mcast_array, 
+p_adapter->mcast_array_size);
+
+		/* Register all existing addresses. */
+		ipoib_reg_addrs( p_adapter );
+
+		/* Now that we're in the broadcast group, notify that we
have a link. */
+		IPOIB_TRACE( IPOIB_DBG_INFO, ("Clinet Reregister!\n") );
+		NdisMIndicateStatus( p_adapter->h_adapter,
NDIS_STATUS_MEDIA_CONNECT,
+			NULL, 0 );
+		NdisMIndicateStatusComplete( p_adapter->h_adapter );
+		break;
 	default:
 		/* Join all programmed multicast groups. */
 		for( i = 0; i < p_adapter->mcast_array_size; i++ )
Index: ulp/ipoib/kernel/ipoib_endpoint.c
===================================================================
--- ulp/ipoib/kernel/ipoib_endpoint.c	(revision 355)
+++ ulp/ipoib/kernel/ipoib_endpoint.c	(working copy)
@@ -196,7 +196,7 @@
 	}
 	cl_obj_unlock( p_obj );
 	
-	IPOIB_EXIT( IPOIB_DBG_INIT );
+	IPOIB_EXIT( IPOIB_DBG_ENDPT );
 }
 
 
Index: ulp/ipoib/kernel/ipoib_endpoint.h
===================================================================
--- ulp/ipoib/kernel/ipoib_endpoint.h	(revision 355)
+++ ulp/ipoib/kernel/ipoib_endpoint.h	(working copy)
@@ -148,7 +148,7 @@
 {
 	IPOIB_ENTER( IPOIB_DBG_ENDPT );
 	cl_obj_deref( &p_endpt->obj );
-	IPOIB_EXIT( IPOIB_DBG_INIT );
+	IPOIB_EXIT( IPOIB_DBG_ENDPT );
 }
 
 
Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c	(revision 355)
+++ ulp/ipoib/kernel/ipoib_port.c	(working copy)
@@ -421,7 +421,7 @@
 *
****************************************************************************
**/
 static void
-__port_get_mcast(
+__port_get_bcast(
 	IN				ipoib_port_t* const
p_port );
 
 static void
@@ -680,6 +680,7 @@
 }
 
 
+
 static void
 __port_free(
 	IN				cl_obj_t* const
p_obj )
@@ -4045,6 +4046,30 @@
 
 
 static ib_api_status_t
+__endpt_mgr_remove_bcast(
+	IN				ipoib_port_t* const
p_port)
+{
+	ipoib_endpt_t		*p_endpt;
+
+	IPOIB_ENTER( IPOIB_DBG_INIT );	
+
+	/* Remove the broadcast endpoint. */
+	p_endpt = __endpt_mgr_get_by_gid(p_port,
&p_port->ib_mgr.bcast_rec.mgid);
+	if( !p_endpt )
+	{
+		IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,
+			("__endpt_mgr_get_by_gid failed.\n") );
+		return IB_INVALID_GID;
+	}
+	
+	__endpt_mgr_remove( p_port, p_endpt );
+
+	IPOIB_EXIT( IPOIB_DBG_INIT );
+	return IB_SUCCESS;
+	
+}
+
+static ib_api_status_t
 __endpt_mgr_add_bcast(
 	IN				ipoib_port_t* const
p_port,
 	IN				ib_mcast_rec_t
*p_mcast_rec )
@@ -4353,7 +4378,7 @@
 				p_port_rec->port_info.link_width_active) );
 			ipoib_set_rate( p_port->p_adapter,
 				p_port_rec->port_info.link_width_active );
-			__port_get_mcast( p_port );
+			__port_get_bcast( p_port );
 		}
 		else
 		{
@@ -4386,7 +4411,7 @@
 
 
 static void
-__port_get_mcast(
+__port_get_bcast(
 	IN				ipoib_port_t* const
p_port )
 {
 	ib_api_status_t		status;
@@ -4716,7 +4741,7 @@
 			state isn't IB_PNP_PORT_ADD or PORT_DOWN? */
 			CL_ASSERT( p_port->p_adapter->state ==
IB_PNP_PORT_ADD ||
 				p_port->p_adapter->state == IB_PNP_PORT_DOWN
);
-			__port_get_mcast( p_port );
+			__port_get_bcast( p_port );
 		}
 		else
 		{
@@ -5034,3 +5059,28 @@
 
 	IPOIB_EXIT( IPOIB_DBG_MCAST );
 }
+
+
+ib_api_status_t
+ipoib_port_client_reregister(
+	IN				ipoib_port_t* const
p_port)
+{
+	ib_api_status_t		status = IB_SUCCESS;
+
+	IPOIB_ENTER( IPOIB_DBG_INIT );	
+
+	/* Initiate cleanup of all endpoints */
+	status = __endpt_mgr_remove_bcast( p_port );
+	if( status != IB_SUCCESS )
+	{
+		IPOIB_TRACE( IPOIB_DBG_ERROR,
+			("__endpt_mgr_remove_bcast returned %s.\n",
+			p_port->p_adapter->p_ifc->get_err_str( status )) );
+		IPOIB_EXIT( IPOIB_DBG_INIT );
+		return status;
+	}
+	__port_get_bcast( p_port);
+	
+	IPOIB_EXIT( IPOIB_DBG_INIT );
+	return status;
+}
Index: ulp/ipoib/kernel/ipoib_port.h
===================================================================
--- ulp/ipoib/kernel/ipoib_port.h	(revision 355)
+++ ulp/ipoib/kernel/ipoib_port.h	(working copy)
@@ -560,6 +560,10 @@
 	IN				ipoib_port_t* const
p_port,
 	IN		const	mac_addr_t
mac );
 
+ib_api_status_t
+ipoib_port_client_reregister(
+	IN				ipoib_port_t* const
p_port);
+
 void
 ipoib_port_remove_endpt(
 	IN				ipoib_port_t* const
p_port,



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20050912/66856578/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client_reregister.patch
Type: application/octet-stream
Size: 19839 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20050912/66856578/attachment.obj>


More information about the ofw mailing list