bnxt_re: Fix compare and swap atomic operands
authorDevesh Sharma <devesh.sharma@broadcom.com>
Thu, 31 Aug 2017 03:57:30 +0000 (09:27 +0530)
committerDoug Ledford <dledford@redhat.com>
Fri, 22 Sep 2017 17:57:32 +0000 (13:57 -0400)
Driver must assign the user supplied compare/swap values in
the wqe to successfully complete the atomic compare and
swap operation.

Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index 11bbf3e748b046edb07ec9a52f6e78392ddf7690..0dbdbe1616abb807c478778181278d1154e331e3 100644 (file)
@@ -1916,6 +1916,7 @@ static int bnxt_re_build_atomic_wqe(struct ib_send_wr *wr,
        switch (wr->opcode) {
        case IB_WR_ATOMIC_CMP_AND_SWP:
                wqe->type = BNXT_QPLIB_SWQE_TYPE_ATOMIC_CMP_AND_SWP;
+               wqe->atomic.cmp_data = atomic_wr(wr)->compare_add;
                wqe->atomic.swap_data = atomic_wr(wr)->swap;
                break;
        case IB_WR_ATOMIC_FETCH_AND_ADD: