[openib-general] Re: SDP_CONN_LOCK
Michael S. Tsirkin
mst at mellanox.co.il
Tue Feb 22 01:33:04 PST 2005
Quoting r. Libor Michalek <libor at topspin.com>:
> Subject: Re: SDP_CONN_LOCK
>
> On Thu, Feb 17, 2005 at 05:35:17PM +0200, Michael S. Tsirkin wrote:
> > Hi, Libor!
> > Could you please explain what are the SDP_CONN_LOCK
> > and friends doing in SDP?
> >
> > It seems they just implement exclusive access to socket,
> > but if so, why is a simple semaphore or mutex not used?
>
> They do implement exclusive access to the socket, but they implement
> exclusive access from both process and irq context, which is why a
> semaphore was not used. In interrupt context SDP_CONN_LOCK_BH is used
> to lock the connection, look in sdp_cq_event_handler() for it's use,
> and in process context SDP_CONN_LOCK is used.
By the way, I think you are supposed to change the task state
with set_current_state (or _set_current_state if you are absolutely
shure).
--
MST - Michael S. Tsirkin
More information about the general
mailing list