RDMA/rxe: Convert kernel UD post send to use ah_num
authorBob Pearson <rpearsonhpe@gmail.com>
Thu, 7 Oct 2021 20:40:52 +0000 (15:40 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 12 Oct 2021 16:25:27 +0000 (13:25 -0300)
Modify ib_post_send for kernel UD sends to put the AH index into the WQE
instead of the address vector.

Link: https://lore.kernel.org/r/20211007204051.10086-7-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_verbs.c

index e20f2dd..0aa0d7e 100644 (file)
@@ -534,8 +534,11 @@ static void init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,
        if (qp_type(qp) == IB_QPT_UD ||
            qp_type(qp) == IB_QPT_SMI ||
            qp_type(qp) == IB_QPT_GSI) {
+               struct ib_ah *ibah = ud_wr(ibwr)->ah;
+
                wr->wr.ud.remote_qpn = ud_wr(ibwr)->remote_qpn;
                wr->wr.ud.remote_qkey = ud_wr(ibwr)->remote_qkey;
+               wr->wr.ud.ah_num = to_rah(ibah)->ah_num;
                if (qp_type(qp) == IB_QPT_GSI)
                        wr->wr.ud.pkey_index = ud_wr(ibwr)->pkey_index;
                if (wr->opcode == IB_WR_SEND_WITH_IMM)
@@ -607,12 +610,6 @@ static void init_send_wqe(struct rxe_qp *qp, const struct ib_send_wr *ibwr,
                return;
        }
 
-       if (qp_type(qp) == IB_QPT_UD ||
-           qp_type(qp) == IB_QPT_SMI ||
-           qp_type(qp) == IB_QPT_GSI)
-               memcpy(&wqe->wr.wr.ud.av, &to_rah(ud_wr(ibwr)->ah)->av,
-                      sizeof(struct rxe_av));
-
        if (unlikely(ibwr->send_flags & IB_SEND_INLINE))
                copy_inline_data_to_wqe(wqe, ibwr);
        else