[ofw] [Patch][IPoIB_NDIS6_CM] Take a lock when calling __endpt_mgr_insert ()

Smith, Stan stan.smith at intel.com
Fri Nov 26 13:25:45 PST 2010


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: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Alex Naslednikov
Sent: Thursday, November 25, 2010 1:54 AM
To: ofw at lists.openfabrics.org
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 )
               {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101126/dbcbdbbc/attachment.html>


More information about the ofw mailing list