[Openib-windows] RE: IPoIB multicast support

Yossi Leybovich sleybo at mellanox.co.il
Tue Nov 8 10:20:04 PST 2005


Fab

I found that when the IPoIB is asked to send multicast packet it does
not create/join/query 
the Mcgroup but try to look for the endpoint in the endpoint list.(and
of course not find it) 

My patch check if the MAC is multicast mac and then if the lookup failed
its 
issue join request to the SA and return with STATUS_PENDING
(I still need to check if the send side need to join the Mcgroup or just
query for the LID and use it in the endpnt AV)

In the mcast_cb I call send_resume to complete the send request.

This indeed solve the problem and the mcast test pass !!.

I also add some Debug info that I found useful

NOTE: 
I did not handle MAC other then 01-00-5E-XX-XX-XX 
1. because I still didn't understood what exactly the signature that use
is for (i.e 0x06-0x6A)
2. I don't know if this will work against Linux IPoIB

We can start with this and then update if there is changes.

Pls review

10x
Yossi 

Index: ulp/ipoib/kernel/ipoib_endpoint.c
===================================================================
--- ulp/ipoib/kernel/ipoib_endpoint.c	(revision 712)
+++ ulp/ipoib/kernel/ipoib_endpoint.c	(working copy)
@@ -159,7 +159,13 @@
 	ib_api_status_t	status;
 
 	IPOIB_ENTER( IPOIB_DBG_ENDPT );
-
+	
+	IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO),
+		("create av fot:\t  MAC:
%02X-%02X-%02X-%02X-%02X-%02X\n",
+		p_endpt->mac.addr[0], p_endpt->mac.addr[1],
+		p_endpt->mac.addr[2], p_endpt->mac.addr[3],
+		p_endpt->mac.addr[4], p_endpt->mac.addr[5]));
+		
 	status = __create_mcast_av( h_pd, port_num,
p_mcast_rec->p_member_rec,
 		&p_endpt->h_av );
 	if( status != IB_SUCCESS )
Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c	(revision 712)
+++ ulp/ipoib/kernel/ipoib_port.c	(working copy)
@@ -1674,6 +1674,16 @@
 		*pp_dst = p_port->p_local_endpt;
 		CL_ASSERT( *pp_dst );
 	}
+	IPOIB_TRACE_EXIT( (IPOIB_DBG_RECV | IPOIB_DBG_INFO),
+		("recv :\n"
+		"\tsrc MAC: %02X-%02X-%02X-%02X-%02X-%02X\n"
+		"\tdst MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",
+		(*pp_src )->mac.addr[0], (*pp_src )->mac.addr[1],
+		(*pp_src )->mac.addr[2], (*pp_src )->mac.addr[3],
+		(*pp_src )->mac.addr[4], (*pp_src )->mac.addr[5],
+		(*pp_dst )->mac.addr[0], (*pp_dst )->mac.addr[1],
+		(*pp_dst )->mac.addr[2], (*pp_dst )->mac.addr[3],
+		(*pp_dst )->mac.addr[4], (*pp_dst )->mac.addr[5]));
 
 	IPOIB_EXIT( IPOIB_DBG_RECV );
 }
@@ -3904,17 +3914,34 @@
 	IPOIB_ENTER( IPOIB_DBG_ENDPT );
 
 	key = 0;
-    *pp_endpt = NULL;
+	*pp_endpt = NULL;
 	cl_memcpy( &key, &mac, sizeof(mac_addr_t) );
 
 	cl_obj_lock( &p_port->obj );
+	IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO),
+		("look for :\t  MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",
+		mac.addr[0], mac.addr[1],
+		mac.addr[2], mac.addr[3],
+		mac.addr[4], mac.addr[5]));
 
+	
+	
 	p_item = cl_qmap_get( &p_port->endpt_mgr.mac_endpts, key );
 	if( p_item == cl_qmap_end( &p_port->endpt_mgr.mac_endpts ) )
 	{
-		cl_obj_unlock( &p_port->obj );
-		IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, ("Failed endpoint
lookup.\n") );
-		return NDIS_STATUS_NO_ROUTE_TO_DESTINATION;
+		if( mac.addr[0] == 1 && mac.addr[1] == 0 && mac.addr[2]
== 0x5E )
+		{
+			cl_obj_unlock( &p_port->obj );
+			ipoib_port_join_mcast(p_port, mac);
+			IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, ("Multicast
Mac try to join.\n") );
+			return NDIS_STATUS_PENDING;
+		}
+		else
+		{
+			cl_obj_unlock( &p_port->obj );
+			IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, ("Failed
endpoint lookup.\n") );
+			return NDIS_STATUS_NO_ROUTE_TO_DESTINATION;
+		}
 	}
 
 	*pp_endpt = PARENT_STRUCT( p_item, ipoib_endpt_t, mac_item );
@@ -4020,7 +4047,11 @@
 	IN				ipoib_endpt_t* const
p_endpt )
 {
 	IPOIB_ENTER( IPOIB_DBG_ENDPT );
-
+	IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO),
+		("insert  :\t  MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",
+		mac.addr[0], mac.addr[1],
+		mac.addr[2], mac.addr[3],
+		mac.addr[4], mac.addr[5]));
 	cl_obj_lock( &p_port->obj );
 	while( p_port->endpt_rdr )
 	{
@@ -5062,8 +5093,14 @@
 			&p_port->endpt_mgr.lid_endpts, p_endpt->dlid,
&p_endpt->lid_item );
 		CL_ASSERT( p_qitem == &p_endpt->lid_item );
 	}
+
 	cl_obj_unlock( &p_port->obj );
 	cl_obj_deref( &p_port->obj );
+	
+	/* Try to send all pending sends. */
+	ipoib_port_resume( p_port );
+	
+	
 
 	IPOIB_EXIT( IPOIB_DBG_MCAST );
 }

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_multicast.patch
Type: application/octet-stream
Size: 3486 bytes
Desc: ipoib_multicast.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051108/e7dbdf1c/attachment.obj>


More information about the ofw mailing list