From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCHv4 2/2] NVMe: Use CMB for the IO SQes if available
Date: Fri, 17 Jul 2015 00:51:23 -0700 [thread overview]
Message-ID: <20150717075123.GB31679@infradead.org> (raw)
In-Reply-To: <1437087088-1628-3-git-send-email-jonathan.derrick@intel.com>
On Thu, Jul 16, 2015@04:51:28PM -0600, Jon Derrick wrote:
> +static int use_cmb_sqes = 1;
> +module_param(use_cmb_sqes, int, 0644);
> +MODULE_PARM_DESC(use_cmb_sqes, "use controller's memory buffer for I/O SQes");
This should be a bool.
> +static void nvme_alloc_sq_cmds(struct nvme_dev *dev, struct nvme_queue *nvmeq,
> + int qid, int depth)
> +{
> + if (qid && dev->cmb && use_cmb_sqes && NVME_CMB_SQS(dev->cmbsz)) {
> + unsigned offset = (qid - 1) *
> + roundup(SQ_SIZE(depth), dev->page_size);
> + nvmeq->sq_dma_addr = dev->cmb_dma_addr + offset;
> + nvmeq->sq_cmds_io = dev->cmb + offset;
> + } else {
> + nvmeq->sq_cmds = dma_alloc_coherent(dev->dev, SQ_SIZE(depth),
> + &nvmeq->sq_dma_addr, GFP_KERNEL);
> + }
> +}
Can you just return an error on allocation failure here insead of
checking sq_cmds after the call to the function?
next prev parent reply other threads:[~2015-07-17 7:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 22:51 [PATCHv4 0/2] NVMe: Enable SQes on the CMB Jon Derrick
2015-07-16 22:51 ` [PATCHv4 1/2] NVMe: Unify SQ entry writing and doorbell ringing Jon Derrick
2015-07-17 7:49 ` Christoph Hellwig
2015-07-16 22:51 ` [PATCHv4 2/2] NVMe: Use CMB for the IO SQes if available Jon Derrick
2015-07-17 7:51 ` Christoph Hellwig [this message]
2015-07-17 15:46 ` Jon Derrick
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=20150717075123.GB31679@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox