Skip to contentSkip to conversation

RDMA/rxe: Remove redundant num_sge fields

PATCH Applied Bob Pearson 3 participants 3 messages Sep 13, 2022 – Sep 26, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/rxe: Remove redundant num_sge fields

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.

---
 drivers/infiniband/sw/rxe/rxe_verbs.c | 2 --
 include/uapi/rdma/rdma_user_rxe.h     | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/sw/rxe/rxe_verbs.c +0 -2
index 9ebe9decad34..7073a0a0adf4 100644
@@ -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;
 
include/uapi/rdma/rdma_user_rxe.h +2 -2
index f09c5c9e3dd5..73f679dfd2df 100644
@@ -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;
 };

base-commit: db77d84cfe3608eac938302f8f7178e44415bcba

Signature · 1 line
2.34.1
#1 lore raw
Quoted 8 lines · Bob Pearson

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

maintainer Applied
#2 lore raw
In reply to Bob Pearson
Quoted 9 lines · Bob Pearson

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.

Quoted 5 lines
---
 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