Alex, Look at broadcast_cb() which lock the the port->obj, then calls add_local() which now locks port->obj prior to __endpt_mgr_insert()....oops! Looks like this patch is not valid. Perhaps a comment around __endpt_mgr_insert() would clear things up, as the caller to add_local() has already locket the port obj.
stan. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Alex Naslednikov Sent: Thursday, November 25, 2010 1:54 AM To: [email protected] Subject: [ofw] [Patch][IPoIB_NDIS6_CM] Take a lock when calling __endpt_mgr_insert () __endpt_mgr_insert () works with CL objects like queues that are not thread-safe. In order to protect on these objects, one need to take a lock Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il) Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp =================================================================== --- ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (revision 2999) +++ ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (working copy) @@ -7242,9 +7242,11 @@ /* __endpt_mgr_insert expects *one* reference to be held. */ cl_atomic_inc( &p_port->endpt_rdr ); + cl_obj_lock( &p_port->obj ); status = __endpt_mgr_insert( p_port, p_port->p_adapter->params.conf_mac, p_endpt ); + cl_obj_unlock( &p_port->obj ); cl_atomic_dec( &p_port->endpt_rdr ); if( status != IB_SUCCESS ) {
_______________________________________________ ofw mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
