Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] nvme: Remove double assignment of cq vector
@ 2019-09-05 14:50 Israel Rukshin
  2019-09-05 14:59 ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Israel Rukshin @ 2019-09-05 14:50 UTC (permalink / raw)
  To: Linux-nvme; +Cc: Max Gurtovoy, Christoph Hellwig, Israel Rukshin, Sagi Grimberg

Poll queues don't use it, so the assignment should be only when
using IRQs.

Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
---
 drivers/nvme/host/pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 10d3071d6098..492074c95b9b 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1560,7 +1560,6 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
 	else if (result)
 		goto release_cq;
 
-	nvmeq->cq_vector = vector;
 	nvme_init_queue(nvmeq, qid);
 
 	if (!polled) {
-- 
2.16.3


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Remove double assignment of cq vector
  2019-09-05 14:50 [PATCH] nvme: Remove double assignment of cq vector Israel Rukshin
@ 2019-09-05 14:59 ` Keith Busch
  2019-09-05 15:10   ` Israel Rukshin
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2019-09-05 14:59 UTC (permalink / raw)
  To: Israel Rukshin; +Cc: Max Gurtovoy, Christoph Hellwig, Linux-nvme, Sagi Grimberg

On Thu, Sep 05, 2019 at 02:50:48PM +0000, Israel Rukshin wrote:
> Poll queues don't use it, so the assignment should be only when
> using IRQs.

It's not really a double assignment. An interrupt driven queue may become
a polled queue after a reset, in which case this assignment serves to
clear it's previously assigned vector. It doesn't actually appear to
matter if we've cleared it or not when the NVMEQ_POLLED flag is set,
though.

 
> Signed-off-by: Israel Rukshin <israelr@mellanox.com>
> Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
> ---
>  drivers/nvme/host/pci.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 10d3071d6098..492074c95b9b 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -1560,7 +1560,6 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
>  	else if (result)
>  		goto release_cq;
>  
> -	nvmeq->cq_vector = vector;
>  	nvme_init_queue(nvmeq, qid);
>  
>  	if (!polled) {
> -- 
> 2.16.3

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Remove double assignment of cq vector
  2019-09-05 14:59 ` Keith Busch
@ 2019-09-05 15:10   ` Israel Rukshin
  2019-09-05 15:21     ` Keith Busch
  2019-09-05 15:22     ` Max Gurtovoy
  0 siblings, 2 replies; 5+ messages in thread
From: Israel Rukshin @ 2019-09-05 15:10 UTC (permalink / raw)
  To: Keith Busch; +Cc: Max Gurtovoy, Christoph Hellwig, Linux-nvme, Sagi Grimberg

On 9/5/2019 5:59 PM, Keith Busch wrote:
> It's not really a double assignment. An interrupt driven queue may become
> a polled queue after a reset, in which case this assignment serves to
> clear it's previously assigned vector. It doesn't actually appear to
> matter if we've cleared it or not when the NVMEQ_POLLED flag is set,
> though.

So what about the second assignment when polled is false?

         nvmeq->cq_vector = vector;
         nvme_init_queue(nvmeq, qid);

         if (!polled) {
                 nvmeq->cq_vector = vector; <<<<<
                 result = queue_request_irq(nvmeq);


Regards,

Israel

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Remove double assignment of cq vector
  2019-09-05 15:10   ` Israel Rukshin
@ 2019-09-05 15:21     ` Keith Busch
  2019-09-05 15:22     ` Max Gurtovoy
  1 sibling, 0 replies; 5+ messages in thread
From: Keith Busch @ 2019-09-05 15:21 UTC (permalink / raw)
  To: Israel Rukshin; +Cc: Max Gurtovoy, Christoph Hellwig, Linux-nvme, Sagi Grimberg

On Thu, Sep 05, 2019 at 03:10:35PM +0000, Israel Rukshin wrote:
> On 9/5/2019 5:59 PM, Keith Busch wrote:
> > It's not really a double assignment. An interrupt driven queue may become
> > a polled queue after a reset, in which case this assignment serves to
> > clear it's previously assigned vector. It doesn't actually appear to
> > matter if we've cleared it or not when the NVMEQ_POLLED flag is set,
> > though.
> 
> So what about the second assignment when polled is false?
> 
>          nvmeq->cq_vector = vector;
>          nvme_init_queue(nvmeq, qid);
> 
>          if (!polled) {
>                  nvmeq->cq_vector = vector; <<<<<
>                  result = queue_request_irq(nvmeq);

Oh sure, that one serves no purpose at all.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Remove double assignment of cq vector
  2019-09-05 15:10   ` Israel Rukshin
  2019-09-05 15:21     ` Keith Busch
@ 2019-09-05 15:22     ` Max Gurtovoy
  1 sibling, 0 replies; 5+ messages in thread
From: Max Gurtovoy @ 2019-09-05 15:22 UTC (permalink / raw)
  To: Israel Rukshin, Keith Busch; +Cc: Christoph Hellwig, Linux-nvme, Sagi Grimberg


On 9/5/2019 6:10 PM, Israel Rukshin wrote:
> On 9/5/2019 5:59 PM, Keith Busch wrote:
>> It's not really a double assignment. An interrupt driven queue may become
>> a polled queue after a reset, in which case this assignment serves to
>> clear it's previously assigned vector. It doesn't actually appear to
>> matter if we've cleared it or not when the NVMEQ_POLLED flag is set,
>> though.
> So what about the second assignment when polled is false?
>
>           nvmeq->cq_vector = vector;
>           nvme_init_queue(nvmeq, qid);
>
>           if (!polled) {
>                   nvmeq->cq_vector = vector; <<<<<

let's remove the second assignment. The first one is good enough for 
both IMO.


>                   result = queue_request_irq(nvmeq);
>
>
> Regards,
>
> Israel
>

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 14:50 [PATCH] nvme: Remove double assignment of cq vector Israel Rukshin
2019-09-05 14:59 ` Keith Busch
2019-09-05 15:10   ` Israel Rukshin
2019-09-05 15:21     ` Keith Busch
2019-09-05 15:22     ` Max Gurtovoy

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org linux-nvme@archiver.kernel.org
	public-inbox-index linux-nvme


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/ public-inbox