linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 0/3] nvme: fix iod size calculation in nvme_probe()
@ 2020-07-17  0:51 Chaitanya Kulkarni
  2020-07-17  0:51 ` [PATCH V4 1/3] nvme-core: replace ctrl page size with a macro Chaitanya Kulkarni
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2020-07-17  0:51 UTC (permalink / raw)
  To: kbusch, hch, sagi; +Cc: Chaitanya Kulkarni, linux-nvme

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

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

end of thread, other threads:[~2020-07-20 13:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  0:51 [PATCH V4 0/3] nvme: fix iod size calculation in nvme_probe() Chaitanya Kulkarni
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

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).