All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH] nvmet-rdma: Invoke fatal error on error completion
Date: Fri, 24 Jun 2016 00:11:01 -0700	[thread overview]
Message-ID: <20160624071101.GC4252@infradead.org> (raw)
In-Reply-To: <1466701290-10356-1-git-send-email-sagi@grimberg.me>

On Thu, Jun 23, 2016@08:01:30PM +0300, Sagi Grimberg wrote:
> In case we got an error completion the rdma queue pair
> is in error state, teardown the entire controller. Note
> that in recv or read error completion we might not have
> a controller yet, so check for the controller exsistence.
> 
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>

This looks fine minus a few minor codingstyle nitpicks that I'd be
happy to fix up:

> +static void nvmet_rdma_error_comp(struct nvmet_rdma_queue *queue)
> +{
> +	if (queue->nvme_sq.ctrl)
> +		nvmet_ctrl_fatal_error(queue->nvme_sq.ctrl);
> +	else
> +		/*
> +		 * we didn't setup the controller yet in case
> +		 * of admin connect error, just disconnect and
> +		 * cleanup the queue
> +		 */
> +		nvmet_rdma_queue_disconnect(queue);
> +}

With such a long comment I'd prefer to have curly braces just to make
the else visually more obvious
> +
> +	if (unlikely(wc->status != IB_WC_SUCCESS &&
> +		wc->status != IB_WC_WR_FLUSH_ERR)) {

Indenting the second line of a condition by a single tab is always wrong,
either indent it with two tabs, or so that it aligns with first line.
The second is probably nicer here:

	if (unlikely(wc->status != IB_WC_SUCCESS &&
		     wc->status != IB_WC_WR_FLUSH_ERR)) {

Given how many !success not !flush_err conditionals we have in various
drivers I wonder if we should have a helper in the RDMA core, though.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
Cc: linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] nvmet-rdma: Invoke fatal error on error completion
Date: Fri, 24 Jun 2016 00:11:01 -0700	[thread overview]
Message-ID: <20160624071101.GC4252@infradead.org> (raw)
In-Reply-To: <1466701290-10356-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>

On Thu, Jun 23, 2016 at 08:01:30PM +0300, Sagi Grimberg wrote:
> In case we got an error completion the rdma queue pair
> is in error state, teardown the entire controller. Note
> that in recv or read error completion we might not have
> a controller yet, so check for the controller exsistence.
> 
> Signed-off-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>

This looks fine minus a few minor codingstyle nitpicks that I'd be
happy to fix up:

> +static void nvmet_rdma_error_comp(struct nvmet_rdma_queue *queue)
> +{
> +	if (queue->nvme_sq.ctrl)
> +		nvmet_ctrl_fatal_error(queue->nvme_sq.ctrl);
> +	else
> +		/*
> +		 * we didn't setup the controller yet in case
> +		 * of admin connect error, just disconnect and
> +		 * cleanup the queue
> +		 */
> +		nvmet_rdma_queue_disconnect(queue);
> +}

With such a long comment I'd prefer to have curly braces just to make
the else visually more obvious
> +
> +	if (unlikely(wc->status != IB_WC_SUCCESS &&
> +		wc->status != IB_WC_WR_FLUSH_ERR)) {

Indenting the second line of a condition by a single tab is always wrong,
either indent it with two tabs, or so that it aligns with first line.
The second is probably nicer here:

	if (unlikely(wc->status != IB_WC_SUCCESS &&
		     wc->status != IB_WC_WR_FLUSH_ERR)) {

Given how many !success not !flush_err conditionals we have in various
drivers I wonder if we should have a helper in the RDMA core, though.

--
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

  reply	other threads:[~2016-06-24  7:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 17:01 [PATCH] nvmet-rdma: Invoke fatal error on error completion Sagi Grimberg
2016-06-23 17:01 ` Sagi Grimberg
2016-06-24  7:11 ` Christoph Hellwig [this message]
2016-06-24  7:11   ` Christoph Hellwig
2016-06-26 15:57   ` Sagi Grimberg
2016-06-26 15:57     ` Sagi Grimberg

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=20160624071101.GC4252@infradead.org \
    --to=hch@infradead.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.