linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH resend 2/3] nvme-pci: allocate device queues storage space at probe
Date: Tue, 23 Jan 2018 09:06:42 -0700	[thread overview]
Message-ID: <20180123160641.GA14790@localhost.localdomain> (raw)
In-Reply-To: <20180114103902.6413-3-sagi@grimberg.me>

On Sun, Jan 14, 2018@12:39:01PM +0200, Sagi Grimberg wrote:
> @@ -1590,14 +1580,12 @@ static int nvme_pci_configure_admin_queue(struct nvme_dev *dev)
>  	if (result < 0)
>  		return result;
>  
> -	nvmeq = dev->queues[0];
> -	if (!nvmeq) {
> -		nvmeq = nvme_alloc_queue(dev, 0, NVME_AQ_DEPTH,
> -					dev_to_node(dev->dev));
> -		if (!nvmeq)
> -			return -ENOMEM;
> -	}
> +	result = nvme_alloc_queue(dev, 0, NVME_AQ_DEPTH,
> +			dev_to_node(dev->dev));
> +	if (result)
> +		return result;
>  
> +	nvmeq = &dev->queues[0];
>  	aqa = nvmeq->q_depth - 1;
>  	aqa |= aqa << 16;

This is reallocting the admin queue on each reset, leaking the previous
allocation's SQ/CQ memory, then creates an incorrect queue_count. This
was already applied, so I'll send a quick fix.

  reply	other threads:[~2018-01-23 16:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-14 10:38 [PATCH resend 0/3] couple of nvme patches resend Sagi Grimberg
2018-01-14 10:39 ` [PATCH resend 1/3] nvme-pci: serialize pci resets Sagi Grimberg
2018-01-14 10:39 ` [PATCH resend 2/3] nvme-pci: allocate device queues storage space at probe Sagi Grimberg
2018-01-23 16:06   ` Keith Busch [this message]
2018-01-14 10:39 ` [PATCH resend 3/3] nvme-core/loop/rdma: Host delete_work and reset_work on separate workqueues Sagi Grimberg
2018-01-15 15:22 ` [PATCH resend 0/3] couple of nvme patches resend 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=20180123160641.GA14790@localhost.localdomain \
    --to=keith.busch@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).