Skip to content

Commit c13c90e

Browse files
Bart Van Asschedledford
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Alex Estrin <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 2739b59 commit c13c90e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/infiniband/ulp/srpt/ib_srpt.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,8 +2252,18 @@ static void srpt_cm_rej_recv(struct srpt_rdma_ch *ch,
22522252
const u8 *private_data,
22532253
u8 private_data_len)
22542254
{
2255-
pr_info("Received CM REJ for ch %s-%d; reason %d.\n",
2256-
ch->sess_name, ch->qp->qp_num, reason);
2255+
char *priv = NULL;
2256+
int i;
2257+
2258+
if (private_data_len && (priv = kmalloc(private_data_len * 3 + 1,
2259+
GFP_KERNEL))) {
2260+
for (i = 0; i < private_data_len; i++)
2261+
sprintf(priv + 3 * i, " %02x", private_data[i]);
2262+
}
2263+
pr_info("Received CM REJ for ch %s-%d; reason %d%s%s.\n",
2264+
ch->sess_name, ch->qp->qp_num, reason, private_data_len ?
2265+
"; private data" : "", priv ? priv : " (?)");
2266+
kfree(priv);
22572267
srpt_drain_channel(ch);
22582268
}
22592269

0 commit comments

Comments
 (0)