Skip to content

Commit cfc0312

Browse files
rpearsonhpe-designjgunthorpe
authored andcommitted
RDMA/rxe: Move AV from rxe_send_wqe to rxe_send_wr
Move the struct rxe_av av from struct rxe_send_wqe to struct rxe_send_wr placing it in wr.ud at the same offset as it was previously. This has the effect of increasing the size of struct rxe_send_wr while keeping the size of struct rxe_send_wqe the same. This better reflects the use of this field which is only used for UD sends. This change has no effect on ABI compatibility so the modified rxe driver will operate with older versions of rdma-core. Link: https://lore.kernel.org/r/20211007204051.10086-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent f4e56ec commit cfc0312

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎drivers/infiniband/sw/rxe/rxe_av.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,5 @@ struct rxe_av *rxe_get_av(struct rxe_pkt_info *pkt)
107107
if (qp_type(pkt->qp) == IB_QPT_RC || qp_type(pkt->qp) == IB_QPT_UC)
108108
return &pkt->qp->pri_av;
109109

110-
return (pkt->wqe) ? &pkt->wqe->av : NULL;
110+
return (pkt->wqe) ? &pkt->wqe->wr.wr.ud.av : NULL;
111111
}

‎drivers/infiniband/sw/rxe/rxe_verbs.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ static void init_send_wqe(struct rxe_qp *qp, const struct ib_send_wr *ibwr,
581581
if (qp_type(qp) == IB_QPT_UD ||
582582
qp_type(qp) == IB_QPT_SMI ||
583583
qp_type(qp) == IB_QPT_GSI)
584-
memcpy(&wqe->av, &to_rah(ud_wr(ibwr)->ah)->av, sizeof(wqe->av));
584+
memcpy(&wqe->wr.wr.ud.av, &to_rah(ud_wr(ibwr)->ah)->av,
585+
sizeof(struct rxe_av));
585586

586587
if (unlikely(ibwr->send_flags & IB_SEND_INLINE))
587588
copy_inline_data_to_wqe(wqe, ibwr);

‎include/uapi/rdma/rdma_user_rxe.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ struct rxe_send_wr {
9898
__u32 remote_qpn;
9999
__u32 remote_qkey;
100100
__u16 pkey_index;
101+
__u16 reserved;
102+
__u32 pad[5];
103+
struct rxe_av av;
101104
} ud;
102105
struct {
103106
__aligned_u64 addr;
@@ -148,7 +151,6 @@ struct rxe_dma_info {
148151

149152
struct rxe_send_wqe {
150153
struct rxe_send_wr wr;
151-
struct rxe_av av;
152154
__u32 status;
153155
__u32 state;
154156
__aligned_u64 iova;

0 commit comments

Comments
 (0)