[PATCH V4 0/3] nvme: fix iod size calculation in nvme_probe()
Chaitanya Kulkarni
chaitanya.kulkarni at wdc.com
Thu Jul 16 20:51:36 EDT 2020
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
More information about the Linux-nvme
mailing list