[Openib-windows] Lock at recv_cb

Fabian Tillier ftillier at silverstorm.com
Thu Jul 27 12:37:17 PDT 2006


Hi Yossi,

On 7/27/06, Yossi Leybovich <sleybo at mellanox.co.il> wrote:
>
> Fab
>
> Is there any use for the lock ipoib_port @ 1570

Yes

>  cl_obj_lock( &p_port->obj );
>  cl_atomic_inc( &p_port->endpt_rdr );
>  cl_obj_unlock( &p_port->obj );
> SInce its atomic inc can we remove the lock ?

No, you can't eliminate the lock - the lock is what provides
serialization between readers and writers.

The writer takes the lock and then spins until endpt_rdr reaches 1
(since writers are expected to have taken a reader reference).

Existing readers will finish their processing and decrement the reader
count without the lock.

So the lock serializes acquisition, but not release.

Hopefully that makes sense - let me know if you see some issues with
this or have any questions.

Thanks,

- Fab




More information about the ofw mailing list