From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 1/8] nvme/pci: Use a flag for polled queues
Date: Mon, 11 Mar 2019 19:25:01 +0100 [thread overview]
Message-ID: <20190311182501.GA11448@lst.de> (raw)
In-Reply-To: <20190308174313.5134-1-keith.busch@intel.com>
On Fri, Mar 08, 2019@10:43:06AM -0700, Keith Busch wrote:
> A negative value for the cq_vector used to mean the queue is either
> disabled or a polled queue. However, we have a queue enabled flag,
> so the cq_vector had been serving double duty.
>
> Don't overload the meaning of cq_vector. Use a flag specific to the
> polled queues instead.
Looks good,
a few nitpicks below:
> - nvmeq->cq_vector = -1;
> + if (!test_and_clear_bit(NVMEQ_POLLED, &nvmeq->flags))
> + pci_free_irq(to_pci_dev(nvmeq->dev->dev), nvmeq->cq_vector, nvmeq);
> return 0;
This creates an > 80 char line.
But given that the nvme_suspend_queue return value is always ignored
you could throw in a prep patch to remove the return value and just
do an early return for the poll case here.
> @@ -1552,7 +1547,7 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
> if (!polled)
> vector = dev->num_vecs == 1 ? 0 : qid;
> else
> - vector = -1;
> + set_bit(NVMEQ_POLLED, &nvmeq->flags);
Between the inversion and the ? : this looks pretty obsfucated.
Can we untangle this to:
if (polled)
set_bit(NVMEQ_POLLED, &nvmeq->flags);
else if (dev->num_vecs == 1)
vector = 0;
else
vector = qid;
Or we might just kill the polled argument and the local vector variable
entirely, set the NVMEQ_POLLED flag in nvme_create_io_queues and
calculate the vector inside adapter_alloc_cq, which would also lose the
vector argument.
next prev parent reply other threads:[~2019-03-11 18:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 17:43 [PATCH 1/8] nvme/pci: Use a flag for polled queues Keith Busch
2019-03-08 17:43 ` [PATCH 2/8] nvme/pci: Don't poll polled queues in timeout Keith Busch
2019-03-11 18:25 ` Christoph Hellwig
2019-03-11 23:33 ` Sagi Grimberg
2019-03-08 17:43 ` [PATCH 3/8] nvme/pci: Remove tag check in nvme_process_cq Keith Busch
2019-03-11 18:26 ` Christoph Hellwig
2019-03-11 23:35 ` Sagi Grimberg
2019-03-08 17:43 ` [PATCH 4/8] nvme/pci: Remove last_cq_seen Keith Busch
2019-03-11 18:28 ` Christoph Hellwig
2019-03-11 23:40 ` Sagi Grimberg
2019-03-27 13:55 ` Christoph Hellwig
2019-03-08 17:43 ` [PATCH 5/8] nvme/pci: Remove last_sq_tail Keith Busch
2019-03-11 18:31 ` Christoph Hellwig
2019-03-11 19:21 ` Keith Busch
2019-03-11 23:53 ` Sagi Grimberg
2019-03-08 17:43 ` [PATCH 6/8] nvme/pci: Remove q_dmadev from nvme_queue Keith Busch
2019-03-11 18:31 ` Christoph Hellwig
2019-03-11 23:54 ` Sagi Grimberg
2019-03-27 13:53 ` Christoph Hellwig
2019-03-08 17:43 ` [PATCH 7/8] nvme/pci: Remove volatile from cqe Keith Busch
2019-03-11 18:33 ` Christoph Hellwig
2019-03-11 23:56 ` Sagi Grimberg
2019-03-27 13:55 ` Christoph Hellwig
2019-03-08 17:43 ` [PATCH 8/8] nvme/pci: Remove unused nvme_iod member Keith Busch
2019-03-11 18:33 ` Christoph Hellwig
2019-03-11 23:56 ` Sagi Grimberg
2019-03-27 13:53 ` Christoph Hellwig
2019-03-11 18:25 ` Christoph Hellwig [this message]
2019-03-11 23:31 ` [PATCH 1/8] nvme/pci: Use a flag for polled queues Sagi Grimberg
2019-03-27 13:53 ` Christoph Hellwig
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=20190311182501.GA11448@lst.de \
--to=hch@lst.de \
/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.