• Bob Pearson's avatar
    RDMA/rxe: Protect QP state with qp->state_lock · f605f26e
    Bob Pearson authored
    Currently the rxe driver makes little effort to make the changes to qp
    state (which includes qp->attr.qp_state, qp->attr.sq_draining and
    qp->valid) atomic between different client threads and IO threads. In
    particular a common template is for an RDMA application to call
    ib_modify_qp() to move a qp to ERR state and then wait until all the
    packet and work queues have drained before calling ib_destroy_qp(). None
    of these state changes are protected by locks to assure that the changes
    are executed atomically and that memory barriers are included. This has
    been observed to lead to incorrect behavior around qp cleanup.
    
    This patch continues the work of the previous patches in this series and
    adds locking code around qp state changes and lookups.
    
    Link: https://lore.kernel.org/r/20230405042611.6467-5-rpearsonhpe@gmail.comSigned-off-by: default avatarBob Pearson <rpearsonhpe@gmail.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    f605f26e
rxe_qp.c 18 KB