• Bryan Tan's avatar
    RDMA/vmw_pvrdma: Use resource ids from physical device if available · a52dc3a1
    Bryan Tan authored
    This change allows the RDMA stack to use physical resource numbers if they
    are passed up from the device. This is accomplished by separating the
    concept of the QP number from the QP handle. Previously, the two were the
    same, as the QP number was exposed to the guest and also used to reference
    a virtual QP in the device backend.
    
    With physical resource numbers exposed, the QP number given to the guest
    is the number assigned from the physical HCA's QP, while the QP handle is
    still the internal handle used to reference a virtual QP. Regardless of
    whether the device is exposing physical ids, the driver will still try to
    pick up the QP handle from the backend if possible. The MR keys exposed to
    the guest will also be the MR keys created by the physical HCA, instead of
    virtual MR keys. The distinction between handle and keys is already
    present for MRs so there is no need to do anything special here.
    
    A new version of the create QP response has been added to the device API
    to pass up the QP number and handle. The driver will also report these to
    userspace in the udata response if userspace supports it or not create the
    queuepair if not. I also had to do a refactor of the destroy qp code to
    reuse it if we fail to copy to userspace.
    
    Link: https://lore.kernel.org/r/20191028181444.19448-1-aditr@vmware.comReviewed-by: default avatarJorgen Hansen <jhansen@vmware.com>
    Signed-off-by: default avatarAdit Ranadive <aditr@vmware.com>
    Signed-off-by: default avatarBryan Tan <bryantan@vmware.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
    a52dc3a1
pvrdma_dev_api.h 17.7 KB