From e2337b86ddee6fa6e991e10f5365283cb2f5bb58 Mon Sep 17 00:00:00 2001 From: sleybo Date: Thu, 14 Dec 2006 11:30:55 +0000 Subject: [PATCH] [IBAL]attach QP to MC group only in case of full member join git-svn-id: svn://openib.tc.cornell.edu/gen1@560 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/al/al_mcast.c | 11 ++++++++--- trunk/ulp/ipoib/kernel/ipoib_adapter.c | 4 ++-- trunk/ulp/ipoib/kernel/ipoib_port.c | 19 +++++++++++-------- trunk/ulp/ipoib/kernel/ipoib_port.h | 3 ++- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/trunk/core/al/al_mcast.c b/trunk/core/al/al_mcast.c index 7dfca76e..fbf1feb8 100644 --- a/trunk/core/al/al_mcast.c +++ b/trunk/core/al/al_mcast.c @@ -503,9 +503,14 @@ join_async_cb( */ h_mcast->state = SA_REG_ACTIVE; /* Attach the QP to the multicast group. */ - status = verbs_attach_mcast(h_mcast); - if( status == IB_SUCCESS ) - mcast_rec.h_mcast = h_mcast; + if(ib_member_get_state(mcast_rec.p_member_rec->scope_state) == IB_MC_REC_STATE_FULL_MEMBER) + { + status = verbs_attach_mcast(h_mcast); + if( status != IB_SUCCESS ) + AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_MCAST, ("attach_mcast failed\n") ); + } + mcast_rec.h_mcast = h_mcast; + } else { diff --git a/trunk/ulp/ipoib/kernel/ipoib_adapter.c b/trunk/ulp/ipoib/kernel/ipoib_adapter.c index 97eef50a..0434814f 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_adapter.c +++ b/trunk/ulp/ipoib/kernel/ipoib_adapter.c @@ -756,7 +756,7 @@ ipoib_refresh_mcast( if( j != p_adapter->mcast_array_size ) continue; - ipoib_port_join_mcast( p_port, p_mac_array[i] ); + ipoib_port_join_mcast( p_port, p_mac_array[i] ,IB_MC_REC_STATE_FULL_MEMBER); } } @@ -976,7 +976,7 @@ ipoib_set_active( for( i = 0; i < p_adapter->mcast_array_size; i++ ) { ipoib_port_join_mcast( - p_adapter->p_port, p_adapter->mcast_array[i] ); + p_adapter->p_port, p_adapter->mcast_array[i] ,IB_MC_REC_STATE_FULL_MEMBER); } /* Register all existing addresses. */ diff --git a/trunk/ulp/ipoib/kernel/ipoib_port.c b/trunk/ulp/ipoib/kernel/ipoib_port.c index eb3981b6..f1d1a618 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_port.c +++ b/trunk/ulp/ipoib/kernel/ipoib_port.c @@ -1241,9 +1241,9 @@ __buf_mgr_put_recv_list( IN ipoib_port_t* const p_port, IN cl_qlist_t* const p_list ) { - IPOIB_ENTER( IPOIB_DBG_RECV ); + //IPOIB_ENTER( IPOIB_DBG_RECV ); cl_qpool_put_list( &p_port->buf_mgr.recv_pool, p_list ); - IPOIB_EXIT( IPOIB_DBG_RECV ); + //IPOIB_EXIT( IPOIB_DBG_RECV ); } @@ -1388,7 +1388,7 @@ __recv_mgr_repost( if( !p_next ) { IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV, - ("Out of receive descriptors!\n") ); + ("Out of receive descriptors! recv queue depath 0x%x\n",p_port->recv_mgr.depth) ); break; } @@ -3503,7 +3503,8 @@ __send_mgr_queue( if( status == NDIS_STATUS_NO_ROUTE_TO_DESTINATION && ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) ) { - if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) == IB_SUCCESS ) + if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst, + IB_MC_REC_STATE_SEND_ONLY_MEMBER) == IB_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND, ("Multicast Mac - trying to join.\n") ); @@ -3775,8 +3776,8 @@ ipoib_port_resume( if( ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) ) { - if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) == - IB_SUCCESS ) + if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst, + IB_MC_REC_STATE_SEND_ONLY_MEMBER) == IB_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND, ("Multicast Mac - trying to join.\n") ); @@ -5322,7 +5323,8 @@ __ib_mgr_activate( ib_api_status_t ipoib_port_join_mcast( IN ipoib_port_t* const p_port, - IN const mac_addr_t mac ) + IN const mac_addr_t mac, + IN const uint8_t state) { ib_api_status_t status; ib_mcast_req_t mcast_req; @@ -5356,7 +5358,8 @@ ipoib_port_join_mcast( /* Clear fields that aren't specified in the join */ mcast_req.member_rec.mlid = 0; mcast_req.member_rec.mtu = 0; - mcast_req.member_rec.rate = 0; + mcast_req.member_rec.rate = 0; + ib_member_set_state( &mcast_req.member_rec.scope_state,state); if( mac.addr[0] == 1 && mac.addr[1] == 0 && mac.addr[2] == 0x5E ) { diff --git a/trunk/ulp/ipoib/kernel/ipoib_port.h b/trunk/ulp/ipoib/kernel/ipoib_port.h index c7322d70..046d1500 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_port.h +++ b/trunk/ulp/ipoib/kernel/ipoib_port.h @@ -565,7 +565,8 @@ ipoib_port_down( ib_api_status_t ipoib_port_join_mcast( IN ipoib_port_t* const p_port, - IN const mac_addr_t mac ); + IN const mac_addr_t mac, + IN const uint8_t state ); void ipoib_port_remove_endpt( -- 2.41.0