Re: About a shortcoming of the verbs API

Bart Van Assche
2010-07-27T18:03:25Z

On Tue, Jul 27, 2010 at 6:50 PM, Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> wrote:
> [ ... ]
>
> From Documentation/infiniband/core_locking.txt:
>
>  The low-level driver is responsible for ensuring that multiple
>  completion event handlers for the same CQ are not called
>  simultaneously.  The driver must guarantee that only one CQ event
>  handler for a given CQ is running at a time.  In other words, the
>  following situation is not allowed:
>
>        CPU1                                    CPU2
>
>  low-level driver ->
>    consumer CQ event callback:
>      /* ... */
>      ib_req_notify_cq(cq, ...);
>                                        low-level driver ->
>      /* ... */                           consumer CQ event callback:
>                                            /* ... */
>      return from CQ event handler
>
> mean that the problem you are complaining about doesn't actually exist?

As far as I know it is not possible for a HCA to tell whether or not a
CPU has finished executing the interrupt it triggered. So it is not
possible for the HCA to implement the above requirement by delaying
the generation of a new interrupt -- implementing the above
requirement is only possible in the low-level driver. A low-level
driver could e.g. postpone notification reenabling until the end of
the interrupt handler or it could use a spinlock to prevent
simultaneous execution of notification handlers. I have inspected the
source code of one particular low-level driver but could not find any
such provisions. Did I overlook something ?

Bart.