All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	sagig-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org,
	hch-jcswGhMUV9g@public.gmane.org,
	axboe-b10kYP2dOMg@public.gmane.org
Subject: Re: [PATCH RFC v2 3/3] nvme-rdma: use rdma_reject_msg() to log connection rejects
Date: Fri, 21 Oct 2016 14:23:18 +0200	[thread overview]
Message-ID: <20161021122318.GB17325@lst.de> (raw)
In-Reply-To: <60243a2ce17e08cdc93600b9998698dbd7f83306.1477003235.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

On Thu, Oct 20, 2016 at 03:40:29PM -0700, Steve Wise wrote:
> @@ -1237,18 +1237,22 @@ out_destroy_queue_ib:
>  static int nvme_rdma_conn_rejected(struct nvme_rdma_queue *queue,
>  		struct rdma_cm_event *ev)
>  {
> +	struct rdma_cm_id *cm_id = queue->cm_id;
> +	int rdma_status = ev->status;
> +	short nvme_status = -1;
> +
> +	if (rdma_consumer_reject(cm_id, rdma_status) &&
> +	    ev->param.conn.private_data_len) {
>  		struct nvme_rdma_cm_rej *rej =
>  			(struct nvme_rdma_cm_rej *)ev->param.conn.private_data;

Given the nasty casting issues in the current RDMA/CM API maybe we should
actually expand the scope of the rdma_consumer_reject helper to include
the above check, e.g. check that there is a private data len and then
return a pointer to the private data?

Something like

static int nvme_rdma_conn_rejected(struct nvme_rdma_queue *queue,
		struct rdma_cm_event *ev)
{
	struct rdma_cm_id *cm_id = queue->cm_id;
	struct nvme_rdma_cm_rej *rej
	short nvme_status = -1;

	rej = rdma_cm_reject_message(ev);
	if (rej)
		nvme_status = le16_to_cpu(rej->sts);

>  
> +	dev_err(queue->ctrl->ctrl.device, "Connect rejected: status %d (%s) "
> +		"nvme status %d.\n", rdma_status,
> +		rdma_reject_msg(cm_id, rdma_status), nvme_status);

And while we're pretty printing the rest it would be nice to pretty
print the NVMe status here as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH RFC v2 3/3] nvme-rdma: use rdma_reject_msg() to log connection rejects
Date: Fri, 21 Oct 2016 14:23:18 +0200	[thread overview]
Message-ID: <20161021122318.GB17325@lst.de> (raw)
In-Reply-To: <60243a2ce17e08cdc93600b9998698dbd7f83306.1477003235.git.swise@opengridcomputing.com>

On Thu, Oct 20, 2016@03:40:29PM -0700, Steve Wise wrote:
> @@ -1237,18 +1237,22 @@ out_destroy_queue_ib:
>  static int nvme_rdma_conn_rejected(struct nvme_rdma_queue *queue,
>  		struct rdma_cm_event *ev)
>  {
> +	struct rdma_cm_id *cm_id = queue->cm_id;
> +	int rdma_status = ev->status;
> +	short nvme_status = -1;
> +
> +	if (rdma_consumer_reject(cm_id, rdma_status) &&
> +	    ev->param.conn.private_data_len) {
>  		struct nvme_rdma_cm_rej *rej =
>  			(struct nvme_rdma_cm_rej *)ev->param.conn.private_data;

Given the nasty casting issues in the current RDMA/CM API maybe we should
actually expand the scope of the rdma_consumer_reject helper to include
the above check, e.g. check that there is a private data len and then
return a pointer to the private data?

Something like

static int nvme_rdma_conn_rejected(struct nvme_rdma_queue *queue,
		struct rdma_cm_event *ev)
{
	struct rdma_cm_id *cm_id = queue->cm_id;
	struct nvme_rdma_cm_rej *rej
	short nvme_status = -1;

	rej = rdma_cm_reject_message(ev);
	if (rej)
		nvme_status = le16_to_cpu(rej->sts);

>  
> +	dev_err(queue->ctrl->ctrl.device, "Connect rejected: status %d (%s) "
> +		"nvme status %d.\n", rdma_status,
> +		rdma_reject_msg(cm_id, rdma_status), nvme_status);

And while we're pretty printing the rest it would be nice to pretty
print the NVMe status here as well.

  parent reply	other threads:[~2016-10-21 12:23 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 22:40 [PATCH RFC v2 0/3] connect reject event helpers Steve Wise
2016-10-20 22:40 ` Steve Wise
     [not found] ` <cover.1477003235.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-10-20 22:40   ` [PATCH RFC v2 1/3] rdma_cm: add rdma_reject_msg() helper function Steve Wise
2016-10-20 22:40     ` Steve Wise
     [not found]     ` <1360f08b7c25f3befcd6836b47af81e2ecb51b75.1477003235.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-10-21 12:12       ` Christoph Hellwig
2016-10-21 12:12         ` Christoph Hellwig
     [not found]         ` <20161021121234.GA17028-jcswGhMUV9g@public.gmane.org>
2016-10-21 14:07           ` Steve Wise
2016-10-21 14:07             ` Steve Wise
2016-10-21 21:43             ` Sagi Grimberg
2016-10-21 21:43               ` Sagi Grimberg
2016-10-21 21:51       ` Sagi Grimberg
2016-10-21 21:51         ` Sagi Grimberg
2016-10-20 22:40   ` [PATCH RFC v2 2/3] rdma_cm: add rdma_consumer_reject() " Steve Wise
2016-10-20 22:40     ` Steve Wise
     [not found]     ` <cb135696be86c21c144ef35a4d6f7f71394a3627.1477003235.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-10-21 12:14       ` Christoph Hellwig
2016-10-21 12:14         ` Christoph Hellwig
     [not found]         ` <20161021121428.GB17028-jcswGhMUV9g@public.gmane.org>
2016-10-21 14:09           ` Steve Wise
2016-10-21 14:09             ` Steve Wise
2016-10-21 15:50             ` Parav Pandit
2016-10-21 15:50               ` Parav Pandit
     [not found]               ` <CAG53R5Xyp+n7KYj6zZF6PFuXke3XtqaMgaGTRmgd_uGXTFNDtw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-21 21:45                 ` Sagi Grimberg
2016-10-21 21:45                   ` Sagi Grimberg
2016-10-22 15:57           ` Steve Wise
2016-10-22 15:57             ` Steve Wise
2016-10-20 22:40   ` [PATCH RFC v2 3/3] nvme-rdma: use rdma_reject_msg() to log connection rejects Steve Wise
2016-10-20 22:40     ` Steve Wise
     [not found]     ` <60243a2ce17e08cdc93600b9998698dbd7f83306.1477003235.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-10-21 12:23       ` Christoph Hellwig [this message]
2016-10-21 12:23         ` Christoph Hellwig
     [not found]         ` <20161021122318.GB17325-jcswGhMUV9g@public.gmane.org>
2016-10-21 21:48           ` Sagi Grimberg
2016-10-21 21:48             ` Sagi Grimberg
2016-10-22 16:12           ` Steve Wise
2016-10-22 16:12             ` Steve Wise
     [not found]         ` <005701d22c7f$0c883ed0$2598bc70$@opengridcomputing.com>
2016-10-24 14:57           ` Steve Wise
2016-10-24 14:57             ` Steve Wise
2016-10-24 15:09             ` 'Christoph Hellwig'
2016-10-24 15:09               ` 'Christoph Hellwig'
2016-10-21 21:53   ` [PATCH RFC v2 0/3] connect reject event helpers Sagi Grimberg
2016-10-21 21:53     ` Sagi Grimberg
     [not found]     ` <a46f48f3-01b3-fd9b-b642-c20555759107-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2016-10-21 21:58       ` Steve Wise
2016-10-21 21:58         ` Steve Wise
     [not found]     ` <001701d22be6$4854b8b0$d8fe2a10$@opengridcomputing.com>
2016-10-24 17:44       ` Steve Wise
2016-10-24 17:44         ` Steve Wise
2016-10-24 17:52         ` Chuck Lever
2016-10-24 17:52           ` Chuck Lever
     [not found]           ` <2F5E122E-0B50-4264-8E44-3D484B0282F0-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-10-24 17:57             ` Steve Wise
2016-10-24 17:57               ` Steve Wise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161021122318.GB17325@lst.de \
    --to=hch-jcswghmuv9g@public.gmane.org \
    --cc=axboe-b10kYP2dOMg@public.gmane.org \
    --cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sagig-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.