[openib-general] userspace doorbells

Michael S. Tsirkin mst at mellanox.co.il
Wed Mar 16 08:58:41 PST 2005


Quoting r. Roland Dreier <roland at topspin.com>:
> Subject: Re: ANNOUNCE: First usable version of userspace verbs
> 
>     Michael> I think I have discovered the problem. It seems that with
>     Michael> -O3 my compiler may reorder the WQE (and possibly CQE)
>     Michael> write with respect to the doorbell.  This wont happen on
>     Michael> i386 with consistent i/o ordering since the doorbell is
>     Michael> done in assembly, and probably not on other 32 bit
>     Michael> architectures since the mutex is likely to include a
>     Michael> memory barrier.
> 
>     Michael> Applying the folowing patch fixes the problem for me for
>     Michael> x86_64.
> 
> Thanks for diagnosing this.  I think I want to work on a more general
> fix though.
> 
>  - R.
> 

Roland, I see you have made the doorbell page volatile.
This makes sence, and must be enough on x86_64, but for this to work on PPC,
wont you still need to insert a write memory barrier, to guard against
the CPU re-ordering writes to hardware and to the WQE?
Since you do it in kernel, why not in userspace?

-- 
MST - Michael S. Tsirkin



More information about the general mailing list