linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: kbusch@kernel.org, hch@lst.de, sagi@grimberg.me
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	linux-nvme@lists.infradead.org
Subject: [PATCH V4 0/3] nvme: fix iod size calculation in nvme_probe()
Date: Thu, 16 Jul 2020 17:51:36 -0700	[thread overview]
Message-ID: <20200717005139.18923-1-chaitanya.kulkarni@wdc.com> (raw)

Hi,

This is a small patch series which fixes the IO size calulation in the
nvme_probe.

The first patch replaces the ctrl->page_size with a macro. The second
patch calculates the maximum value based on NVMe PRP and SGL size.

I've tested this patch with different block sizes 4k-128k on NVMe QEMU
and NVMe PCIe (non-SGL) controller.

In this version I've also added 3rd patch to get rid of the division in
nvme_unmap_data() since we've hardcoded the value of the ctrl page size
in the macro.

Regards,
Chaitanya

* Chagnes from V3:-
-------------------

1. Use (1 << NVME_CTRL_PAGE_SHIF)T for NVME_CTRL_PAGE_SIZE value.
2. Remove size and nseg parameters for the nvme_pci_iod_alloc_size() and
   hardcode them in the code.   
3. Added 3rd patch to get rid of the division in nvme_unmap_data().

* Changes from V2:-
-------------------

1. Modify commit log for patch 1.
2. Repalace ilog2(NVME_CTRL_PAGE_SIZE) ->  NVME_CTRL_PAGE_SHIFT.

* Changes from V1:-
-------------------

1. Remove the ctrl->page_size and use macro instead.
2. Get rid of the conditional operater and use max_t() for SGL vs PRP
   size calulation.

Chaitanya Kulkarni (3):
  nvme-core: replace ctrl page size with a macro
  nvme-pci: use max of PRP or SGL for iod size
  nvme-pci: get rid of the division in the fast path

 drivers/nvme/host/core.c | 19 ++++--------
 drivers/nvme/host/nvme.h |  9 +++++-
 drivers/nvme/host/pci.c  | 65 +++++++++++++++++++---------------------
 3 files changed, 45 insertions(+), 48 deletions(-)

-- 
2.26.0


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

             reply	other threads:[~2020-07-17  0:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  0:51 Chaitanya Kulkarni [this message]
2020-07-17  0:51 ` [PATCH V4 1/3] nvme-core: replace ctrl page size with a macro Chaitanya Kulkarni
2020-07-17  0:51 ` [PATCH V4 2/3] nvme-pci: use max of PRP or SGL for iod size Chaitanya Kulkarni
2020-07-17  0:51 ` [PATCH V4 3/3] nvme-pci: get rid of the division in the fast path Chaitanya Kulkarni
2020-07-17  2:32   ` Keith Busch
2020-07-17  2:33     ` Chaitanya Kulkarni
2020-07-20 13:21 ` [PATCH V4 0/3] nvme: fix iod size calculation in nvme_probe() 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=20200717005139.18923-1-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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).