vfio/mlx5: Explicitly use number of pages instead of allocated length
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 20 May 2025 13:46:30 +0000 (16:46 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 20 May 2025 14:32:07 +0000 (08:32 -0600)
commit674ebb64cd5dc40827b8ac8c95bb72d328ed59ff
treeaa0a2057b6744ef61e25a0eba147bb4eb62724e6
parent6ef04555b252e60913d3dc80b45f048bfef33d0f
vfio/mlx5: Explicitly use number of pages instead of allocated length

allocated_length is a multiple of page size and number of pages,
so let's change the functions to accept number of pages. This improves
code readability, simplifies buffer handling, and enables combining DMA
send/receive operations, as will be introduced in the next patches.

Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/76f39993d2ca0311b3bcfe56038a669d03926815.1747747694.git.leon@kernel.org
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/mlx5/cmd.c
drivers/vfio/pci/mlx5/cmd.h
drivers/vfio/pci/mlx5/main.c