[Openib-windows] RE: IPoIB multicast support

Fab Tillier ftillier at silverstorm.com
Thu Nov 10 10:44:27 PST 2005


Hi Yossi,

> From: Yossi Leybovich [mailto:sleybo at mellanox.co.il]
> Sent: Thursday, November 10, 2005 5:12 AM
> 
> What about this way :
> In Send create the entpnt and **update its Mac** but give it state of
> not valid (same state like endpnt that waits for path_rec )
> This field will become valid when the join request is finished.
> When NDIS try to create the MC group before creating the entpndt check
> if there is endpnt with this Mac in the list.
> If yes use this endpnt for the MC group check the flag and issue join
> with full membership
> The MC group will be in the list only if NDIS ask for it.

Ok, looking at the code more carefully, the endpoint is created and added to the
MAC and GID maps before the multicast request is issued.  The code as it stood
already didn't account for a send coming down while the MC join is in progress -
the call to ipoib_endpt_queue didn't account for multicast endpoints.

I added checks so that if there is no AV created, then it returns pending if
either there's a path query in progress of the destination QPN is the multicast
QPN (0xFFFFFF).

With this code in place, all that I needed to do in ipoib_port_join_mcast was
perform a lookup on the endpoint, and exit if the endpoint already exists.

The code also already accounts for the endpoint being destroyed while sends are
in progress, and the MC group membership won't be removed until all sends using
that endpoint complete.

I had to restructure your patch a little since I wanted ipoib_port_join_mcast to
be able to use the __endpt_mgr_ref call (thus, that call can't call
ipoib_port_join_mcast).  There were only two spots where that function was
called, and both spots now check for a NDIS_STATUS_NO_ROUTE_TO_DESTINATION
status and call ipoib_port_join_mcast if the MAC is an mcast MAC.

I attach the patch for your review.  I will try to build the mc test case you
sent and test, but if you get around to it before I do and it works let me know
and I'll check this in.  Otherwise I'll send out a mail if I check this in
before then.

Thanks,

- Fab

Index: ulp/ipoib/kernel/ipoib_endpoint.c
===================================================================
--- ulp/ipoib/kernel/ipoib_endpoint.c   (revision 145)
+++ ulp/ipoib/kernel/ipoib_endpoint.c   (working copy)
@@ -159,6 +159,12 @@
 
    IPOIB_ENTER( IPOIB_DBG_ENDPT );
 
+   IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO),
+       ("Create av for 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 )
@@ -277,7 +283,8 @@
        return NDIS_STATUS_SUCCESS;
    }
 
-   if( p_endpt->h_query )
+   if( p_endpt->h_query ||
+       p_endpt->qpn == CL_HTON32(0x00FFFFFF) )
    {
        ipoib_endpt_deref( p_endpt );
        IPOIB_EXIT( IPOIB_DBG_ENDPT );
Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c   (revision 145)
+++ ulp/ipoib/kernel/ipoib_port.c   (working copy)
@@ -1674,6 +1674,17 @@
        CL_ASSERT( *pp_dst );
    }
 
+   IPOIB_TRACE( (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 );
 }
 
@@ -3294,6 +3305,19 @@
    status = __endpt_mgr_ref( p_port, p_eth_hdr->dst, pp_endpt );
    cl_perf_stop( &p_port->p_adapter->perf, GetEndpt );
 
+   if( status == NDIS_STATUS_NO_ROUTE_TO_DESTINATION &&
+       p_eth_hdr->dst.addr[0] == 0x01 &&
+       p_eth_hdr->dst.addr[1] == 0x00 &&
+       p_eth_hdr->dst.addr[2] == 0x5E )
+   {
+       if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) == IB_SUCCESS )
+       {
+           IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT,
+               ("Multicast Mac - trying to join.\n") );
+           return NDIS_STATUS_PENDING;
+       }
+   }
+
    IPOIB_EXIT( IPOIB_DBG_SEND );
    return status;
 }
@@ -3555,6 +3579,22 @@
        else if( status != NDIS_STATUS_SUCCESS )
        {
            ASSERT( status == NDIS_STATUS_NO_ROUTE_TO_DESTINATION );
+
+           if( p_eth_hdr->dst.addr[0] == 0x01 &&
+               p_eth_hdr->dst.addr[1] == 0x00 &&
+               p_eth_hdr->dst.addr[2] == 0x5E )
+           {
+               if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) ==
+                   IB_SUCCESS )
+               {
+                   IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT,
+                       ("Multicast Mac - trying to join.\n") );
+                   cl_qlist_insert_head( &p_port->send_mgr.pending_list,
+                       IPOIB_LIST_ITEM_FROM_PACKET( desc.p_pkt ) );
+                   break;
+               }
+           }
+
            /*
             * Complete the send as if we sent it - WHQL tests don't like the
             * sends to fail.
@@ -3876,6 +3916,11 @@
 
    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 ) )
    {
@@ -3988,6 +4033,11 @@
 {
    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 )
    {
@@ -4866,6 +4916,19 @@
 
    IPOIB_ENTER( IPOIB_DBG_MCAST );
 
+   switch( __endpt_mgr_ref( p_port, mac, &p_endpt ) )
+   {
+   case NDIS_STATUS_NO_ROUTE_TO_DESTINATION:
+       break;
+
+   case NDIS_STATUS_SUCCESS:
+       ipoib_endpt_deref( p_endpt );
+       /* Fall through */
+
+   case NDIS_STATUS_PENDING:
+       return IB_SUCCESS;
+   }
+
    /*
     * Issue the mcast request, using the parameters of the broadcast group.
     * This allows us to do a create request that should always succeed since
@@ -5030,6 +5093,10 @@
        CL_ASSERT( p_qitem == &p_endpt->lid_item );
    }
    cl_obj_unlock( &p_port->obj );
+   
+   /* Try to send all pending sends. */
+   ipoib_port_resume( p_port );
+
    cl_obj_deref( &p_port->obj );
 
    IPOIB_EXIT( IPOIB_DBG_MCAST );
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_multicast.patch.v2
Type: application/octet-stream
Size: 4324 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051110/287a1d39/attachment.obj>


More information about the ofw mailing list