diff mbox series

[for-next] RDMA/rxe: Remove redundant num_sge fields

Message ID 20220913222716.18335-1-rpearsonhpe@gmail.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series [for-next] RDMA/rxe: Remove redundant num_sge fields | expand

Commit Message

Bob Pearson Sept. 13, 2022, 10:27 p.m. UTC
In include/uapi/rdma/rdma_user_rxe.h there are redundant copies of
num_sge in the rxe_send_wr, rxe_recv_wqe, and rxe_dma_info. Only the
ones in rxe_dma_info are actually used by the rxe driver. This patch
replaces the ones in rxe_send_wr and rxe_recv_wqe by reserved. This
patch matches a user space change to the rxe provider driver in
rdma-core. This change has no affect on the current ABI and new or old
versions of rdma-core operate correctly with new or old versions of
the kernel rxe driver.

Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_verbs.c | 2 --
 include/uapi/rdma/rdma_user_rxe.h     | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)


base-commit: db77d84cfe3608eac938302f8f7178e44415bcba

Comments

Leon Romanovsky Sept. 20, 2022, 6:10 p.m. UTC | #1
On Tue, Sep 13, 2022 at 05:27:17PM -0500, Bob Pearson wrote:
> In include/uapi/rdma/rdma_user_rxe.h there are redundant copies of
> num_sge in the rxe_send_wr, rxe_recv_wqe, and rxe_dma_info. Only the
> ones in rxe_dma_info are actually used by the rxe driver. This patch
> replaces the ones in rxe_send_wr and rxe_recv_wqe by reserved. This
> patch matches a user space change to the rxe provider driver in
> rdma-core. This change has no affect on the current ABI and new or old
> versions of rdma-core operate correctly with new or old versions of
> the kernel rxe driver.

I don't see how. Old rdma-core has rxe_post_one_recv() function that
uses num_sge in struct rxe_recv_wqe.

Thanks
Jason Gunthorpe Sept. 26, 2022, 5:57 p.m. UTC | #2
On Tue, Sep 13, 2022 at 05:27:17PM -0500, Bob Pearson wrote:
> In include/uapi/rdma/rdma_user_rxe.h there are redundant copies of
> num_sge in the rxe_send_wr, rxe_recv_wqe, and rxe_dma_info. Only the
> ones in rxe_dma_info are actually used by the rxe driver. This patch
> replaces the ones in rxe_send_wr and rxe_recv_wqe by reserved. This
> patch matches a user space change to the rxe provider driver in
> rdma-core. This change has no affect on the current ABI and new or old
> versions of rdma-core operate correctly with new or old versions of
> the kernel rxe driver.
> 
> Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_verbs.c | 2 --
>  include/uapi/rdma/rdma_user_rxe.h     | 4 ++--
>  2 files changed, 2 insertions(+), 4 deletions(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index 9ebe9decad34..7073a0a0adf4 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -262,7 +262,6 @@  static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
 
 	recv_wqe = queue_producer_addr(rq->queue, QUEUE_TYPE_TO_DRIVER);
 	recv_wqe->wr_id = ibwr->wr_id;
-	recv_wqe->num_sge = num_sge;
 
 	memcpy(recv_wqe->dma.sge, ibwr->sg_list,
 	       num_sge * sizeof(struct ib_sge));
@@ -526,7 +525,6 @@  static void init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,
 			 const struct ib_send_wr *ibwr)
 {
 	wr->wr_id = ibwr->wr_id;
-	wr->num_sge = ibwr->num_sge;
 	wr->opcode = ibwr->opcode;
 	wr->send_flags = ibwr->send_flags;
 
diff --git a/include/uapi/rdma/rdma_user_rxe.h b/include/uapi/rdma/rdma_user_rxe.h
index f09c5c9e3dd5..73f679dfd2df 100644
--- a/include/uapi/rdma/rdma_user_rxe.h
+++ b/include/uapi/rdma/rdma_user_rxe.h
@@ -74,7 +74,7 @@  struct rxe_av {
 
 struct rxe_send_wr {
 	__aligned_u64		wr_id;
-	__u32			num_sge;
+	__u32			reserved;
 	__u32			opcode;
 	__u32			send_flags;
 	union {
@@ -166,7 +166,7 @@  struct rxe_send_wqe {
 
 struct rxe_recv_wqe {
 	__aligned_u64		wr_id;
-	__u32			num_sge;
+	__u32			reserved;
 	__u32			padding;
 	struct rxe_dma_info	dma;
 };