summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srpt
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2016-02-11 11:08:12 -0800
committerDoug Ledford <dledford@redhat.com>2016-02-29 17:12:36 -0500
commitc13c90ea6762d834a07c0aa18134d98794f6fc3d (patch)
tree05a157459a8b46d937c02f84de41ccf2c7e33521 /drivers/infiniband/ulp/srpt
parent2739b592d360fd2031262c034f0f73f6f4b7c394 (diff)
downloadlinux-c13c90ea6762d834a07c0aa18134d98794f6fc3d.tar.bz2
IB/srpt: Log private data associated with REJ
To make it possible to determine why an initiator sent a REJ, log the private data associated with the received REJ packet. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Sagi Grimberg <sagig@mellanox.com> Cc: Alex Estrin <alex.estrin@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/srpt')
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 10bc1333a62c..0bf204ec443e 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2252,8 +2252,18 @@ static void srpt_cm_rej_recv(struct srpt_rdma_ch *ch,
const u8 *private_data,
u8 private_data_len)
{
- pr_info("Received CM REJ for ch %s-%d; reason %d.\n",
- ch->sess_name, ch->qp->qp_num, reason);
+ char *priv = NULL;
+ int i;
+
+ if (private_data_len && (priv = kmalloc(private_data_len * 3 + 1,
+ GFP_KERNEL))) {
+ for (i = 0; i < private_data_len; i++)
+ sprintf(priv + 3 * i, " %02x", private_data[i]);
+ }
+ pr_info("Received CM REJ for ch %s-%d; reason %d%s%s.\n",
+ ch->sess_name, ch->qp->qp_num, reason, private_data_len ?
+ "; private data" : "", priv ? priv : " (?)");
+ kfree(priv);
srpt_drain_channel(ch);
}