All of lore.kernel.org
 help / color / mirror / Atom feed
From: <eagostini@nvidia.com>
To: <dev@dpdk.org>
Cc: Elena Agostini <eagostini@nvidia.com>
Subject: [PATCH v2 1/2] gpudev: add GPU page_size to info
Date: Tue, 8 Mar 2022 23:59:47 +0000	[thread overview]
Message-ID: <20220308235948.16645-1-eagostini@nvidia.com> (raw)
In-Reply-To: <20220301190555.20012-1-eagostini@nvidia.com>

From: Elena Agostini <eagostini@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 <eagostini@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


  parent reply	other threads:[~2022-03-08 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 19:05 [PATCH v1 1/2] gpudev: add GPU page_size to info eagostini
2022-03-01 19:05 ` [PATCH v1 2/2] gpudev: use page_size in comm_list creation eagostini
2022-03-08 23:59 ` eagostini [this message]
2022-03-08 23:59   ` [PATCH v2 " eagostini
2022-03-08 22:32     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220308235948.16645-1-eagostini@nvidia.com \
    --to=eagostini@nvidia.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.