Skip to content
  • Steve Wise's avatar
    IB: new common API for draining queues · 765d6774
    Steve Wise authored
    
    
    Add provider-specific drain_sq/drain_rq functions for providers needing
    special drain logic.
    
    Add static functions __ib_drain_sq() and __ib_drain_rq() which post noop
    WRs to the SQ or RQ and block until their completions are processed.
    This ensures the applications completions for work requests posted prior
    to the drain work request have all been processed.
    
    Add API functions ib_drain_sq(), ib_drain_rq(), and ib_drain_qp().
    
    For the drain logic to work, the caller must:
    
    ensure there is room in the CQ(s) and QP for the drain work request
    and completion.
    
    allocate the CQ using ib_alloc_cq() and the CQ poll context cannot be
    IB_POLL_DIRECT.
    
    ensure that there are no other contexts that are posting WRs concurrently.
    Otherwise the drain is not guaranteed.
    
    Reviewed-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    765d6774