<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=405272306-06092006><FONT face=Arial
size=2>Fab</FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2>Regarding the lock
when changing endpnt fields</FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2>what about this
code:</FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2> /* Create the
AV. */<BR> status =
p_port->p_adapter->p_ifc->create_av(<BR> p_port->ib_mgr.h_pd,
&av_attr, &<STRONG>p_endpt->h_av</STRONG> );<BR> if( status !=
IB_SUCCESS )<BR> {<BR> p_port->p_adapter->hung =
TRUE;<BR> ipoib_endpt_deref( p_endpt
);<BR> <STRONG>cl_obj_unlock( &p_endpt->obj
);<BR></STRONG> IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,<BR> ("ib_create_av failed with %s\n",
<BR> p_port->p_adapter->p_ifc->get_err_str( status ))
);<BR> return;<BR> }<BR></FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2>1. here we change
the av without taking any lock, is it bug ?</FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2>2. why do we need to
release the lock on the endpt->obj we never took it ?</FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2>I would say that
when changing endpt fields we should hold the endpt->obj lock and when
inserting to the list hold the port->obj lock.</FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2>So the code
should lock the endpnt->obj lock then fill all endpnt fields (av and
lid)</FONT></SPAN></DIV>
<DIV><SPAN class=405272306-06092006><FONT face=Arial size=2>And when finish to
fill insert to the lid list while holding the port->obj
lock</DIV></FONT></SPAN></BODY></HTML>