[Openib-windows] IPoIB crash
Yossi Leybovich
sleybo at mellanox.co.il
Tue Sep 5 23:34:28 PDT 2006
Fab
Regarding the lock when changing endpnt fields
what about this code:
/* Create the AV. */
status = p_port->p_adapter->p_ifc->create_av(
p_port->ib_mgr.h_pd, &av_attr, &p_endpt->h_av );
if( status != IB_SUCCESS )
{
p_port->p_adapter->hung = TRUE;
ipoib_endpt_deref( p_endpt );
cl_obj_unlock( &p_endpt->obj );
IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
("ib_create_av failed with %s\n",
p_port->p_adapter->p_ifc->get_err_str( status )) );
return;
}
1. here we change the av without taking any lock, is it bug ?
2. why do we need to release the lock on the endpt->obj we never took it
?
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.
So the code should lock the endpnt->obj lock then fill all endpnt fields
(av and lid)
And when finish to fill insert to the lid list while holding the
port->obj lock
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060906/52da5d6e/attachment.html>
More information about the ofw
mailing list