From: Elena Agostini <eagost...@nvidia.com> Page alignment on the GPU can be different from the CPU page alignment.
Fixes: 9b8cae4d991e ("gpudev: use CPU mapping in communication list") Signed-off-by: Elena Agostini <eagost...@nvidia.com> --- drivers/gpu/cuda/cuda.c | 4 ++++ lib/gpudev/rte_gpudev.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/cuda/cuda.c b/drivers/gpu/cuda/cuda.c index cf9e59535c..8505d39d64 100644 --- a/drivers/gpu/cuda/cuda.c +++ b/drivers/gpu/cuda/cuda.c @@ -523,6 +523,8 @@ cuda_dev_info_get(struct rte_gpu *dev, struct rte_gpu_info *info) } dev->mpshared->info.total_memory = parent_info.total_memory; + dev->mpshared->info.page_size = parent_info.page_size; + /* * GPU Device private info */ @@ -1173,6 +1175,8 @@ cuda_gpu_probe(__rte_unused struct rte_pci_driver *pci_drv, struct rte_pci_devic return -rte_errno; } + dev->mpshared->info.page_size = (size_t)GPU_PAGE_SIZE; + /* * GPU Device private info */ diff --git a/lib/gpudev/rte_gpudev.h b/lib/gpudev/rte_gpudev.h index 7e2401a4b7..971aeacfff 100644 --- a/lib/gpudev/rte_gpudev.h +++ b/lib/gpudev/rte_gpudev.h @@ -61,6 +61,8 @@ struct rte_gpu_info { size_t total_memory; /* Local NUMA memory ID. -1 if unknown. */ int16_t numa_node; + /* Get GPU memory page size. */ + size_t page_size; }; /** Flags passed in notification callback. */ -- 2.17.1