[v2,2/2] gpudev: use page_size in comm_list creation
Checks
Commit Message
From: Elena Agostini <eagostini@nvidia.com>
Memory allocated for CPU mapping the status flag
in the communication list should be aligned to the
GPU page size.
Fixes: 9b8cae4d991e ("gpudev: use CPU mapping in communication list")
Signed-off-by: Elena Agostini <eagostini@nvidia.com>
---
lib/gpudev/gpudev.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Comments
09/03/2022 00:59, eagostini@nvidia.com:
> From: Elena Agostini <eagostini@nvidia.com>
>
> Memory allocated for CPU mapping the status flag
> in the communication list should be aligned to the
> GPU page size.
>
> Fixes: 9b8cae4d991e ("gpudev: use CPU mapping in communication list")
> Signed-off-by: Elena Agostini <eagostini@nvidia.com>
Patches squashed and applied, thanks.
@@ -820,6 +820,7 @@ rte_gpu_comm_create_list(uint16_t dev_id,
uint32_t idx_l;
int ret;
struct rte_gpu *dev;
+ struct rte_gpu_info info;
if (num_comm_items == 0) {
rte_errno = EINVAL;
@@ -833,6 +834,12 @@ rte_gpu_comm_create_list(uint16_t dev_id,
return NULL;
}
+ ret = rte_gpu_info_get(dev_id, &info);
+ if (ret < 0) {
+ rte_errno = ENODEV;
+ return NULL;
+ }
+
comm_list = rte_zmalloc(NULL,
sizeof(struct rte_gpu_comm_list) * num_comm_items, 0);
if (comm_list == NULL) {
@@ -855,7 +862,7 @@ rte_gpu_comm_create_list(uint16_t dev_id,
*/
comm_list[0].status_d = rte_gpu_mem_alloc(dev_id,
sizeof(enum rte_gpu_comm_list_status) * num_comm_items,
- rte_mem_page_size());
+ info.page_size);
if (ret < 0) {
rte_errno = ENOMEM;
return NULL;