1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-21 15:45:02 +00:00

krping: In verbose mode print only first 128 bytes of krping data.

Submitted by:	Hariprasad at Chelsio dot com.
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2014-10-27 22:41:55 +00:00
parent d25d06afc0
commit 1fc7fdace0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273751

View File

@ -1011,9 +1011,17 @@ static void krping_test_server(struct krping_cb *cb)
DEBUG_LOG(cb, "server received read complete\n");
/* Display data in recv buf */
if (cb->verbose)
PRINTF(cb, "server ping data: %s\n",
cb->rdma_buf);
if (cb->verbose) {
if (strlen(cb->rdma_buf) > 128) {
char msgbuf[128];
strlcpy(msgbuf, cb->rdma_buf, sizeof(msgbuf));
PRINTF(cb, "server ping data stripped: %s\n",
msgbuf);
} else
PRINTF(cb, "server ping data: %s\n",
cb->rdma_buf);
}
/* Tell client to continue */
if (cb->server && cb->server_invalidate) {
@ -1713,8 +1721,16 @@ static void krping_test_client(struct krping_cb *cb)
break;
}
if (cb->verbose)
PRINTF(cb, "ping data: %s\n", cb->rdma_buf);
if (cb->verbose) {
if (strlen(cb->rdma_buf) > 128) {
char msgbuf[128];
strlcpy(msgbuf, cb->rdma_buf, sizeof(msgbuf));
PRINTF(cb, "ping data stripped: %s\n",
msgbuf);
} else
PRINTF(cb, "ping data: %s\n", cb->rdma_buf);
}
#ifdef SLOW_KRPING
wait_event_interruptible_timeout(cb->sem, cb->state == ERROR, HZ);
#endif