Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvme-pci: replace NVME_MAX_KB_SZ with NVME_MAX_BYTE

Having a define in kiB units is a bit weird. Also update the
comment now that there is not scatterlist limit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20250625113531.522027-8-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
16353f1b 7ce3c1dd

+5 -5
+5 -5
drivers/nvme/host/pci.c
··· 38 38 #define NVME_SMALL_POOL_SIZE 256 39 39 40 40 /* 41 - * These can be higher, but we need to ensure that any command doesn't 42 - * require an sg allocation that needs more than a page of data. 41 + * Arbitrary upper bound. 43 42 */ 44 - #define NVME_MAX_KB_SZ 8192 43 + #define NVME_MAX_BYTES SZ_8M 45 44 #define NVME_MAX_NR_DESCRIPTORS 5 46 45 47 46 /* ··· 412 413 */ 413 414 static __always_inline int nvme_pci_npages_prp(void) 414 415 { 415 - unsigned max_bytes = (NVME_MAX_KB_SZ * 1024) + NVME_CTRL_PAGE_SIZE; 416 + unsigned max_bytes = NVME_MAX_BYTES + NVME_CTRL_PAGE_SIZE; 416 417 unsigned nprps = DIV_ROUND_UP(max_bytes, NVME_CTRL_PAGE_SIZE); 417 418 return DIV_ROUND_UP(8 * nprps, NVME_CTRL_PAGE_SIZE - 8); 418 419 } ··· 3366 3367 * over a single page. 3367 3368 */ 3368 3369 dev->ctrl.max_hw_sectors = min_t(u32, 3369 - NVME_MAX_KB_SZ << 1, dma_opt_mapping_size(&pdev->dev) >> 9); 3370 + NVME_MAX_BYTES >> SECTOR_SHIFT, 3371 + dma_opt_mapping_size(&pdev->dev) >> 9); 3370 3372 dev->ctrl.max_segments = NVME_MAX_SEGS; 3371 3373 dev->ctrl.max_integrity_segments = 1; 3372 3374 return dev;