Skip to content

Commit fa1fd68

Browse files
zhijianli88jgunthorpe
authored andcommitted
RDMA/rxe: Implement RC RDMA FLUSH service in requester side
Implement FLUSH request operation in the requester. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Zhu Yanjun <[email protected]> Signed-off-by: Li Zhijian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 02e9a31 commit fa1fd68

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

drivers/infiniband/sw/rxe/rxe_req.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ static int next_opcode_rc(struct rxe_qp *qp, u32 opcode, int fits)
241241
IB_OPCODE_RC_SEND_ONLY_WITH_IMMEDIATE :
242242
IB_OPCODE_RC_SEND_FIRST;
243243

244+
case IB_WR_FLUSH:
245+
return IB_OPCODE_RC_FLUSH;
246+
244247
case IB_WR_RDMA_READ:
245248
return IB_OPCODE_RC_RDMA_READ_REQUEST;
246249

@@ -425,11 +428,18 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
425428

426429
/* init optional headers */
427430
if (pkt->mask & RXE_RETH_MASK) {
428-
reth_set_rkey(pkt, ibwr->wr.rdma.rkey);
431+
if (pkt->mask & RXE_FETH_MASK)
432+
reth_set_rkey(pkt, ibwr->wr.flush.rkey);
433+
else
434+
reth_set_rkey(pkt, ibwr->wr.rdma.rkey);
429435
reth_set_va(pkt, wqe->iova);
430436
reth_set_len(pkt, wqe->dma.resid);
431437
}
432438

439+
/* Fill Flush Extension Transport Header */
440+
if (pkt->mask & RXE_FETH_MASK)
441+
feth_init(pkt, ibwr->wr.flush.type, ibwr->wr.flush.level);
442+
433443
if (pkt->mask & RXE_IMMDT_MASK)
434444
immdt_set_imm(pkt, ibwr->ex.imm_data);
435445

@@ -488,6 +498,9 @@ static int finish_packet(struct rxe_qp *qp, struct rxe_av *av,
488498

489499
memset(pad, 0, bth_pad(pkt));
490500
}
501+
} else if (pkt->mask & RXE_FLUSH_MASK) {
502+
/* oA19-2: shall have no payload. */
503+
wqe->dma.resid = 0;
491504
}
492505

493506
if (pkt->mask & RXE_ATOMIC_WRITE_MASK) {

0 commit comments

Comments
 (0)