]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
[PATCH] RDS: Print failed rdma op details if failure is remote access
authorRama Nichanamatlu <rama.nichanamatlu@oracle.com>
Tue, 27 Jun 2017 12:34:16 +0000 (05:34 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 6 Jul 2017 03:06:38 +0000 (20:06 -0700)
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 <rama.nichanamatlu@oracle.com>
Reviewed-by: Avinash Repaka <avinash.repaka@oracle.com>
Reviewed-by: Hakon Bugge <haakon.bugge@oracle.com>
Orabug: 26277933

net/rds/ib_send.c

index 15e0801ecf5308f2b5b2fd84d890a9bf88ba63ee..6992cd105246183cda8ce0d82e6541cf56df49a5 100644 (file)
@@ -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);