• Keith Busch's avatar
    nvme-pci: iod npages fits in s8 · c372cdd1
    Keith Busch authored
    The largest allowed transfer is 4MB, which can use at most 1025 PRPs.
    Each PRP is 8 bytes, so the maximum number of 4k nvme pages needed for
    the iod_list is 3, which fits in an 's8' type.
    
    While modifying this field, change the name to "nr_allocations" to
    better represent that this is referring to the number of units allocated
    from a dma_pool.
    
    Also introduce a BUILD_BUG_ON to ensure we never accidently increase the
    largest transfer limit beyond 127 chained prp lists.
    Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
    Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    c372cdd1
pci.c 93.4 KB