[ofa-general] Re: [PATCHv3 for-2.6.21] IB/mthca: fix race in QP destroy

Michael S. Tsirkin mst at mellanox.co.il
Tue Mar 6 11:58:58 PST 2007


> Quoting Roland Dreier <rdreier at cisco.com>:
> Subject: Re: [PATCHv3 for-2.6.21] IB/mthca: fix race in QP destroy
> 
>  > With current code, when we destroy a QP, we remove it from table first,
>  > and move QP to reset. This is clearly wrong, and this patch fixes this.
> 
> I guess so, but it still leaves some other obvious races.  First, the
> QP is removed from the table before its CQEs are cleaned -- to fix
> this, we should move the mthca_cq_clean() call inside the CQ locks
> (and change mthca_cq_clean to require the CQ lock be held).  Second, I
> think we do need to synchronize against the asynchronous event
> interrupt when freeing a QP.
> 
> I don't think the modify QP to reset code needs to change, since the
> QP is not being removed from the table there.

Yes but here we also must make sure completion events and async events are
flushed out: once QP is in reset no events should be generated.

>  > To fix the issue completely, the simplest approach is to use the same
>  > EQ for completion and async events and for command interface.
>  > I plan to send such a patch next week.
> 
> I don't get it -- how do you handle having multiple completion EQs
> with this idea?

You are right here.
But the point is that multiple completion EQs are not 2.6.21 material.
OK?

-- 
MST



More information about the general mailing list