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

Sagi Grimberg sagi at grimberg.me
Thu Oct 20 00:57:17 PDT 2016


> +	switch (ev->status) {
> +	case IB_CM_REJ_DUPLICATE_LOCAL_COMM_ID:
> +		strlcpy(reason, "duplicate local comm id", sizeof(reason));
> +		break;
> +	case IB_CM_REJ_CONSUMER_DEFINED:
> +		if (ev->param.conn.private_data_len) {
> +			const struct nvme_rdma_cm_rej *rej =
> +				(const void *)ev->param.conn.private_data;
> +
> +			snprintf(reason, sizeof(reason), "status %d",
> +				 le16_to_cpu(rej->sts));
> +			/* XXX: Think of something clever to do here... */
> +		} else {
> +			strlcpy(reason, "no private data", sizeof(reason));
> +		}

Can you add "consumer defined" to the string so we know its an
application error reason?


Otherwise looks fine,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>



More information about the Linux-nvme mailing list