From: Rama Nichanamatlu Date: Tue, 27 Jun 2017 12:34:16 +0000 (-0700) Subject: [PATCH] RDS: Print failed rdma op details if failure is remote access X-Git-Tag: v4.1.12-105.0.20170705_2000~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4d2e1c2babfcabc78ead315dab16f2e30ba606c5;p=users%2Fjedix%2Flinux-maple.git [PATCH] RDS: Print failed rdma op details if failure is remote access Improves diagnosability when RDMA op fails allowing this print to be matched with prints on the responder side; which prints RDMA keys which are prematurely purged by the owning process. Signed-off-by: Rama Nichanamatlu Reviewed-by: Avinash Repaka Reviewed-by: Hakon Bugge Orabug: 26277933 --- diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 15e0801ecf530..6992cd1052461 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c @@ -290,6 +290,7 @@ void rds_ib_send_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc) u32 oldest; u32 i = 0; int nr_sig = 0; + enum ib_wr_opcode opcode; rdsdebug("wc wr_id 0x%llx status %u (%s) byte_len %u imm_data %u\n", (unsigned long long)wc->wr_id, wc->status, @@ -317,6 +318,8 @@ void rds_ib_send_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc) if (send->s_wr.send_flags & IB_SEND_SIGNALED) nr_sig++; + opcode = send->s_wr.opcode; + rm = rds_ib_send_unmap_op(ic, send, wc->status); if (send->s_queued + HZ/2 < jiffies) @@ -335,6 +338,23 @@ void rds_ib_send_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc) oldest = (oldest + 1) % ic->i_send_ring.w_nr; } + /* If remote access error print op details */ + if (unlikely(wc->status == IB_WC_REM_ACCESS_ERR)) { + int y; + u32 len = 0; + u64 remote_addr = 0; + u32 rkey = 0; + + remote_addr = send->s_wr.wr.rdma.remote_addr; + rkey = send->s_wr.wr.rdma.rkey; + + for (y = 0; y < send->s_wr.num_sge; y++) + len += send->s_sge[y].length; + + trace_printk("RDS: Remote access failure op: %d addr: %#llx rkey: %#x len: %u\n", + opcode, remote_addr, rkey, len); + } + rds_ib_ring_free(&ic->i_send_ring, completed); rds_ib_sub_signaled(ic, nr_sig);