public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] RDMA/rxe: Make responder handle RDMA Read failures
@ 2022-10-13  1:47 Daisuke Matsuda
  2022-10-13  1:47 ` [PATCH 2/2] RDMA/rxe: Handle remote errors in the midst of a Read reply sequence Daisuke Matsuda
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Daisuke Matsuda @ 2022-10-13  1:47 UTC (permalink / raw)
  To: linux-rdma, leonro, jgg, zyjzyj2000; +Cc: Daisuke Matsuda, Li Zhijian

Currently, responder can reply packets with invalid payloads if it fails to
copy messages to the packets. Add an error handling in read_reply() to
inform a requesting node of the failure.

Suggested-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
---
FOR REVIEWERS:
  I referred to IB Specification Vol 1-Revision-1.5 to make this patch.
  Please see Ch.9.7.5.2.4, Ch.9.7.4.1.5 and Ch.9.7.5.1.3.

 drivers/infiniband/sw/rxe/rxe_resp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index ed5a09e86417..82b74e926e09 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -809,10 +809,14 @@ static enum resp_states read_reply(struct rxe_qp *qp,
 	if (!skb)
 		return RESPST_ERR_RNR;
 
-	rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt),
-		    payload, RXE_FROM_MR_OBJ);
+	err = rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt),
+			  payload, RXE_FROM_MR_OBJ);
 	if (mr)
 		rxe_put(mr);
+	if (err) {
+		kfree_skb(skb);
+		return RESPST_ERR_RKEY_VIOLATION;
+	}
 
 	if (bth_pad(&ack_pkt)) {
 		u8 *pad = payload_addr(&ack_pkt) + payload;
-- 
2.31.1


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

end of thread, other threads:[~2022-10-24 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-13  1:47 [PATCH 1/2] RDMA/rxe: Make responder handle RDMA Read failures Daisuke Matsuda
2022-10-13  1:47 ` [PATCH 2/2] RDMA/rxe: Handle remote errors in the midst of a Read reply sequence Daisuke Matsuda
2022-10-13  5:36   ` Li Zhijian
2022-10-14  2:35     ` matsuda-daisuke
2022-10-15  2:32       ` Li Zhijian
2022-10-13  4:14 ` [PATCH 1/2] RDMA/rxe: Make responder handle RDMA Read failures Li Zhijian
2022-10-24 17:10 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox