Stan,
We found a problem at this patch and it should not be applied because of the 
lock is always taken at upper layer.
I apologize for the bad patch

From: Smith, Stan [mailto:[email protected]]
Sent: Friday, November 26, 2010 8:06 PM
To: Alex Naslednikov; [email protected]
Subject: RE: [ofw] [Patch][IPoIB_NDIS6_CM] Take a lock when calling 
__endpt_mgr_insert ()

Hello,
  Although your patch is correct, it brings to light a minor issue.

In two places [__recv_get_endpts() & __recv_arp()] calls to 'status = 
__endpt_mgr_insert()', the port lock is not released immediately after the 
insert call.
Instead the lock is held until after the 'status' is checked, thus resulting in 
a extra call to port unlock if the status != 0.
The code could be cleaned up by releasing the port lock immediately after the 
__endpt_mgr_insert() call as shown in your patch.

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

Reply via email to