提交 d4ee7f3a 编写于 作者: B Bart Van Assche 提交者: Jason Gunthorpe

RDMA/srpt: Make debug output more detailed

Since the session name by itself is not sufficient to uniquely identify a
queue pair, include the queue pair number. Show the ASCII channel state
name instead of the numeric value. This change makes the ib_srpt debug
output more consistent.

Link: https://lore.kernel.org/r/20200525172212.14413-3-bvanassche@acm.orgSigned-off-by: NBart Van Assche <bvanassche@acm.org>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 87fee61c
...@@ -214,8 +214,9 @@ static const char *get_ch_state_name(enum rdma_ch_state s) ...@@ -214,8 +214,9 @@ static const char *get_ch_state_name(enum rdma_ch_state s)
*/ */
static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch) static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch)
{ {
pr_debug("QP event %d on ch=%p sess_name=%s state=%d\n", pr_debug("QP event %d on ch=%p sess_name=%s-%d state=%s\n",
event->event, ch, ch->sess_name, ch->state); event->event, ch, ch->sess_name, ch->qp->qp_num,
get_ch_state_name(ch->state));
switch (event->event) { switch (event->event) {
case IB_EVENT_COMM_EST: case IB_EVENT_COMM_EST:
...@@ -1985,8 +1986,8 @@ static void __srpt_close_all_ch(struct srpt_port *sport) ...@@ -1985,8 +1986,8 @@ static void __srpt_close_all_ch(struct srpt_port *sport)
list_for_each_entry(nexus, &sport->nexus_list, entry) { list_for_each_entry(nexus, &sport->nexus_list, entry) {
list_for_each_entry(ch, &nexus->ch_list, list) { list_for_each_entry(ch, &nexus->ch_list, list) {
if (srpt_disconnect_ch(ch) >= 0) if (srpt_disconnect_ch(ch) >= 0)
pr_info("Closing channel %s because target %s_%d has been disabled\n", pr_info("Closing channel %s-%d because target %s_%d has been disabled\n",
ch->sess_name, ch->sess_name, ch->qp->qp_num,
dev_name(&sport->sdev->device->dev), dev_name(&sport->sdev->device->dev),
sport->port); sport->port);
srpt_close_ch(ch); srpt_close_ch(ch);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册