DPDK patches and discussions
 help / color / mirror / Atom feed
From: Elena Agostini <eagostini@nvidia.com>
To: "Wang, Haiyue" <haiyue.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH v4 1/2] gpudev: expose GPU memory to CPU
Date: Thu, 10 Feb 2022 10:38:19 +0000	[thread overview]
Message-ID: <DM6PR12MB41074416E62D561EEE7E9C27CD2F9@DM6PR12MB4107.namprd12.prod.outlook.com> (raw)
In-Reply-To: <BYAPR11MB3495D4CC88E21DC79CDA5C87F7219@BYAPR11MB3495.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]

> From: Wang, Haiyue <haiyue.wang@intel.com>
> Date: Thursday, 27 January 2022 at 07:56
> To: Elena Agostini <eagostini@nvidia.com>, dev@dpdk.org <dev@dpdk.org>
> Subject: RE: [PATCH v4 1/2] gpudev: expose GPU memory to CPU
> External email: Use caution opening links or attachments
>
>
> > -----Original Message-----
> > From: eagostini@nvidia.com <eagostini@nvidia.com>
> > Sent: Thursday, January 27, 2022 11:47
> > To: dev@dpdk.org
> > Cc: Elena Agostini <eagostini@nvidia.com>
> > Subject: [PATCH v4 1/2] gpudev: expose GPU memory to CPU
> >
> > From: Elena Agostini <eagostini@nvidia.com>
> >
> > Enable the possibility to expose a GPU memory area and make it
> > accessible from the CPU.
> >
> > GPU memory has to be allocated via rte_gpu_mem_alloc().
> >
> > This patch allows the gpudev library to map (and unmap),
> > through the GPU driver, a chunk of GPU memory and to return
> > a memory pointer usable by the CPU to access the GPU memory area.
> >
> > Signed-off-by: Elena Agostini <eagostini@nvidia.com>
> > ---
> >  doc/guides/prog_guide/gpudev.rst |  9 +++++
> >  drivers/gpu/cuda/cuda.c          |  2 ++
> >  lib/gpudev/gpudev.c              | 61 ++++++++++++++++++++++++++++++++
> >  lib/gpudev/gpudev_driver.h       |  6 ++++
> >  lib/gpudev/rte_gpudev.h          | 49 +++++++++++++++++++++++++
> >  lib/gpudev/version.map           |  2 ++
> >  6 files changed, 129 insertions(+)
> >
>
>
> > +__rte_experimental
> > +void *rte_gpu_mem_cpu_map(int16_t dev_id, size_t size, void *ptr);
>
> How about add some direction words like "to/from" to make it straightforward ?
>
> For this: rte_gpu_mem_map_to_cpu ?
>
> > +__rte_experimental
> > +int rte_gpu_mem_cpu_unmap(int16_t dev_id, void *ptr);
> > +
>
> And rte_gpu_mem_unmap_to_cpu ?
>
> >  };
> > --
> > 2.17.1

Motivation behind the name is to be compliant with
rte_*_dma_map/unmap() functions where the entity comes first
(DMA) and the action later (map/unmap).

I think your proposal is more readable but it's also too
verbose for an API (map_to_cpu/unmap_from_cpu).

[-- Attachment #2: Type: text/html, Size: 8510 bytes --]

  reply	other threads:[~2022-02-10 10:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04  2:34 [PATCH v1] gpudev: pin GPU memory eagostini
2022-01-04  2:41 ` [PATCH v2] " eagostini
2022-01-04 12:51   ` Thomas Monjalon
2022-01-04 13:55     ` Elena Agostini
2022-01-04 17:28       ` John Alexander
2022-01-04 17:53         ` Elena Agostini
2022-01-08  0:04 ` [PATCH v3] gpudev: expose " eagostini
2022-01-27  3:47 ` [PATCH v4 1/2] gpudev: expose GPU memory to CPU eagostini
2022-01-27  3:47   ` [PATCH v4 2/2] app/test-gpudev: test cpu_map/cpu_unmap functions eagostini
2022-01-27  6:55   ` [PATCH v4 1/2] gpudev: expose GPU memory to CPU Wang, Haiyue
2022-02-10 10:38     ` Elena Agostini [this message]
2022-02-11  4:46       ` Wang, Haiyue
2022-01-27  3:50 ` [PATCH v5 " eagostini
2022-01-27  3:50   ` [PATCH v5 2/2] app/test-gpudev: test cpu_map/cpu_unmap functions eagostini
2022-02-10 15:12   ` [PATCH v5 1/2] gpudev: expose GPU memory to CPU 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=DM6PR12MB41074416E62D561EEE7E9C27CD2F9@DM6PR12MB4107.namprd12.prod.outlook.com \
    --to=eagostini@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).