[PATCH 6/6] nvme/rdma: Make nvme_rdma_conn_rejected() more informative

Bart Van Assche bart.vanassche at sandisk.com
Thu Oct 20 14:08:06 PDT 2016


On 10/20/2016 01:41 PM, Steve Wise wrote:
> And here is a proposed change to nvme_rdma to use rdma_reject_msg().  If you
 > like this idea, I'll send out these two patches, or send them to you to
 > include in your series.
>
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 601aecf..41a2d4c 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -1237,18 +1237,19 @@ out_destroy_queue_ib:
>  static int nvme_rdma_conn_rejected(struct nvme_rdma_queue *queue,
>                 struct rdma_cm_event *ev)
>  {
> +       short nvme_status = -1;
> +
>         if (ev->param.conn.private_data_len) {
>                 struct nvme_rdma_cm_rej *rej =
>                         (struct nvme_rdma_cm_rej *)ev->param.conn.private_data;
>
> -               dev_err(queue->ctrl->ctrl.device,
> -                       "Connect rejected, status %d.", le16_to_cpu(rej->sts));
> -               /* XXX: Think of something clever to do here... */
> -       } else {
> -               dev_err(queue->ctrl->ctrl.device,
> -                       "Connect rejected, no private data.\n");
> +               nvme_status = le16_to_cpu(rej->sts);
>         }
>
> +       dev_err(queue->ctrl->ctrl.device, "Connect rejected: status %d (%s) "
> +               "nvme status %d.\n", ev->status,
> +               rdma_reject_msg(queue->cm_id, ev->status), nvme_status);
> +
>         return -ECONNRESET;
>  }

Hello Steve,

Had you already realized that the description of my patch 6/6 shows that 
it is not guaranteed on an IB setup that ev->param.conn.private_data_len 
== 0 for other cases than IB_CM_REJ_CONSUMER_DEFINED?

Thanks,

Bart.




More information about the Linux-nvme mailing list