[openib-general] Re: possible race in mthca_alloc_sqp

Michael S. Tsirkin mst at mellanox.co.il
Wed Jan 26 09:12:46 PST 2005


Quoting r. Roland Dreier <roland at topspin.com>:
> Subject: Re: possible race in mthca_alloc_sqp
> 
>     Michael> Hi!  Since mthca_alloc_sqp does not do mthca_array_set as
>     Michael> the last thing, this means that for a while there is an
>     Michael> incomplete entry in the array.  So anyone looking it up
>     Michael> will get an invalid sqp.  Is this a bug? Looks like one.

I just has an idea that we may be able to fix that by using set with a
NULL pointer, then get will return a NULL. A bit complicated ...
what do you think?

> I don't think so.  The only things that could cause a lookup in the QP
> table are async and completion events, and neither of these can occur
> until the QP is fully set up.
> 
>  - R.

I'd like to understand why not.
Consider something like user access, can one thread call mthca_alloc_sqp,
while another posts a wqe?

-- 
I dont speak for Mellanox



More information about the general mailing list