All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 5/8] RDMA/rxe: Make requester support atomic write on RC service
@ 2022-12-01 14:39 Xiao Yang
  2022-12-01 14:39 ` [PATCH v7 6/8] RDMA/rxe: Make responder " Xiao Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xiao Yang @ 2022-12-01 14:39 UTC (permalink / raw)
  To: linux-rdma, jgg, rpearsonhpe
  Cc: leon, lizhijian, y-goto, zyjzyj2000, Xiao Yang

Make requester process and send an atomic write request on RC service.

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 4d45f508392f..2713e9058922 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -258,6 +258,10 @@ static int next_opcode_rc(struct rxe_qp *qp, u32 opcode, int fits)
 		else
 			return fits ? IB_OPCODE_RC_SEND_ONLY_WITH_INVALIDATE :
 				IB_OPCODE_RC_SEND_FIRST;
+
+	case IB_WR_ATOMIC_WRITE:
+		return IB_OPCODE_RC_ATOMIC_WRITE;
+
 	case IB_WR_REG_MR:
 	case IB_WR_LOCAL_INV:
 		return opcode;
@@ -486,6 +490,11 @@ static int finish_packet(struct rxe_qp *qp, struct rxe_av *av,
 		}
 	}
 
+	if (pkt->mask & RXE_ATOMIC_WRITE_MASK) {
+		memcpy(payload_addr(pkt), wqe->dma.atomic_wr, payload);
+		wqe->dma.resid -= payload;
+	}
+
 	return 0;
 }
 
@@ -709,13 +718,15 @@ int rxe_requester(void *arg)
 	}
 
 	mask = rxe_opcode[opcode].mask;
-	if (unlikely(mask & RXE_READ_OR_ATOMIC_MASK)) {
+	if (unlikely(mask & (RXE_READ_OR_ATOMIC_MASK |
+			RXE_ATOMIC_WRITE_MASK))) {
 		if (check_init_depth(qp, wqe))
 			goto exit;
 	}
 
 	mtu = get_mtu(qp);
-	payload = (mask & RXE_WRITE_OR_SEND_MASK) ? wqe->dma.resid : 0;
+	payload = (mask & (RXE_WRITE_OR_SEND_MASK | RXE_ATOMIC_WRITE_MASK)) ?
+			wqe->dma.resid : 0;
 	if (payload > mtu) {
 		if (qp_type(qp) == IB_QPT_UD) {
 			/* C10-93.1.1: If the total sum of all the buffer lengths specified for a
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-15 15:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-01 14:39 [PATCH v7 5/8] RDMA/rxe: Make requester support atomic write on RC service Xiao Yang
2022-12-01 14:39 ` [PATCH v7 6/8] RDMA/rxe: Make responder " Xiao Yang
2022-12-15 15:19   ` Guenter Roeck
2022-12-15 15:32     ` Jason Gunthorpe
2022-12-01 14:39 ` [PATCH v7 7/8] RDMA/rxe: Implement atomic write completion Xiao Yang
2022-12-01 14:39 ` [PATCH v7 8/8] RDMA/rxe: Enable atomic write capability for rxe device Xiao Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.