From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B72EDA0A0A;
	Thu,  3 Jun 2021 09:48:02 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 3B8AA40689;
	Thu,  3 Jun 2021 09:48:02 +0200 (CEST)
Received: from mail-il1-f178.google.com (mail-il1-f178.google.com
 [209.85.166.178])
 by mails.dpdk.org (Postfix) with ESMTP id 8BEE84067A
 for <dev@dpdk.org>; Thu,  3 Jun 2021 09:48:00 +0200 (CEST)
Received: by mail-il1-f178.google.com with SMTP id b9so4702722ilr.2
 for <dev@dpdk.org>; Thu, 03 Jun 2021 00:48:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=e5fPDXLm0HgkB6yDlSHCJd+60F5j3/tTgL9K50BA5PM=;
 b=XhLzLPufiWVnPw2JswE/GFWxvoO3qOm2qn+2INV2ht9YJWZZFIaahGKHaWNEpoXVJP
 OF41FEXJW7LP4HgNYj2lVteDm7LN5kOFSK3po4QewOqrk3zLe01PYPdsUdlAJWCDEqjO
 vATiDzp4ZHU7dimoJVDrTHdLxW0qAqzyA0lCEYgR3eqavI8viJ6m1bSVx78t9Ul2HBhM
 XMhxu7WTrlyhVc35R3BgZb2ZHb2D3CXSMEsf6EW8pbMZGnTKas2w+vBsPtDGVX0BxGOI
 11gjpXXjry/18c44BSuArdfKv2MR+F8eeN8Ltdp9huFeQkPXcfvF84UHFtX4FMcaI0pR
 nu6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=e5fPDXLm0HgkB6yDlSHCJd+60F5j3/tTgL9K50BA5PM=;
 b=jB604Jc3XkirageZQlFORgXTKWU/Ic+Qu8ICvCUpCg/UMnR1AjR/0WzKXM/Hzfk9ni
 jqRzgZQocKdRO3bu2zf5O7jI5OM1/4OM2K5qg/IyT83avideyZgnJ6oGenlnIAWtFake
 tgTfuLM2DeFEcUwminquK9i2Wb2pbsILrH2RdqhVoHtR83kWOtHUOj/7CAJTiu+8bnUj
 cicrPbWrPL+6sAnTHlS0leq3cS3l55Ix5ZXX+VJ0rSlmctzRK9cW3GIuaTU8LnW/tyRE
 QI+oqRTZjbg+qJ4rhIOf6gXPqs6A5diY7J/t5JFpZbbEu8nJVKzPeG2EJPimRWokbIgk
 ErqA==
X-Gm-Message-State: AOAM533ySWAs3Oax5VOEr7HMuH+DtFBmxWgFb+kzqjMMqfI6QgAfzVHh
 CaMPo67jlrJ/xJ6wEOFtW5ytHhqr2X8QWsO7FuA=
X-Google-Smtp-Source: ABdhPJyo6RerMavBKoEynlE91fR3IJlIvbEIfoYlKW9CbJT3BnJr9OT0lRFh4yGJt9YKNY9Ahur7nQk8oDMlf81XtGA=
X-Received: by 2002:a92:d08c:: with SMTP id h12mr4322611ilh.294.1622706479875; 
 Thu, 03 Jun 2021 00:47:59 -0700 (PDT)
MIME-Version: 1.0
References: <20210602203531.2288645-1-thomas@monjalon.net>
In-Reply-To: <20210602203531.2288645-1-thomas@monjalon.net>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Thu, 3 Jun 2021 13:17:43 +0530
Message-ID: <CALBAE1N9B+Z63+XCbbFRa+HZu1rinXkcwMVsWh19UkREvr8XXA@mail.gmail.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dpdk-dev <dev@dpdk.org>, Elena Agostini <eagostini@nvidia.com>
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH] gpudev: introduce memory API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Thu, Jun 3, 2021 at 2:05 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> From: Elena Agostini <eagostini@nvidia.com>
>
> The new library gpudev is for dealing with GPU from a DPDK application
> in a vendor-agnostic way.
>
> As a first step, the features are focused on memory management.
> A function allows to allocate memory inside the GPU,
> while another one allows to use main (CPU) memory from the GPU.
>
> The infrastructure is prepared to welcome drivers in drivers/gpu/
> as the upcoming NVIDIA one, implementing the gpudev API.
> Other additions planned for next revisions:
>   - C implementation file
>   - guide documentation
>   - unit tests
>   - integration in testpmd to enable Rx/Tx to/from GPU memory.
>
> The next step should focus on GPU processing task control.
>
> Signed-off-by: Elena Agostini <eagostini@nvidia.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  .gitignore                           |   1 +
>  MAINTAINERS                          |   6 +
>  doc/api/doxy-api-index.md            |   1 +
>  doc/api/doxy-api.conf.in             |   1 +
>  doc/guides/conf.py                   |   8 ++
>  doc/guides/gpus/features/default.ini |  13 ++
>  doc/guides/gpus/index.rst            |  11 ++
>  doc/guides/gpus/overview.rst         |   7 +
>  doc/guides/index.rst                 |   1 +
>  doc/guides/prog_guide/gpu.rst        |   5 +
>  doc/guides/prog_guide/index.rst      |   1 +
>  drivers/gpu/meson.build              |   4 +
>  drivers/meson.build                  |   1 +
>  lib/gpudev/gpu_driver.h              |  44 +++++++
>  lib/gpudev/meson.build               |   9 ++
>  lib/gpudev/rte_gpudev.h              | 183 +++++++++++++++++++++++++++
>  lib/gpudev/version.map               |  11 ++
>  lib/meson.build                      |   1 +
>  18 files changed, 308 insertions(+)
>  create mode 100644 doc/guides/gpus/features/default.ini
>  create mode 100644 doc/guides/gpus/index.rst
>  create mode 100644 doc/guides/gpus/overview.rst
>  create mode 100644 doc/guides/prog_guide/gpu.rst
>  create mode 100644 drivers/gpu/meson.build
>  create mode 100644 lib/gpudev/gpu_driver.h
>  create mode 100644 lib/gpudev/meson.build
>  create mode 100644 lib/gpudev/rte_gpudev.h
>  create mode 100644 lib/gpudev/version.map
>
> diff --git a/.gitignore b/.gitignore
> index b19c0717e6..49494e0c6c 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -14,6 +14,7 @@ doc/guides/compressdevs/overview_feature_table.txt
>  doc/guides/regexdevs/overview_feature_table.txt
>  doc/guides/vdpadevs/overview_feature_table.txt
>  doc/guides/bbdevs/overview_feature_table.txt
> +doc/guides/gpus/overview_feature_table.txt
>
>  # ignore generated ctags/cscope files
>  cscope.out.po
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5877a16971..c4755dfe9a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -452,6 +452,12 @@ F: app/test-regex/
>  F: doc/guides/prog_guide/regexdev.rst
>  F: doc/guides/regexdevs/features/default.ini
>
> +GPU API - EXPERIMENTAL
> +M: Elena Agostini <eagostini@nvidia.com>
> +F: lib/gpudev/
> +F: doc/guides/prog_guide/gpu.rst
> +F: doc/guides/gpus/features/default.ini
> +
>  Eventdev API
>  M: Jerin Jacob <jerinj@marvell.com>
>  T: git://dpdk.org/next/dpdk-next-eventdev
> diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
> index 1992107a03..bd10342ca2 100644
> --- a/doc/api/doxy-api-index.md
> +++ b/doc/api/doxy-api-index.md
> @@ -21,6 +21,7 @@ The public API headers are grouped by topics:
>    [compressdev]        (@ref rte_compressdev.h),
>    [compress]           (@ref rte_comp.h),
>    [regexdev]           (@ref rte_regexdev.h),
> +  [gpudev]             (@ref rte_gpudev.h),

Since this device does not have a queue etc? Shouldn't make it a
library like mempool with vendor-defined ops?
Any specific reason for making it a device? The reason why I am asking
this is, as other DPDK devices as symmetry in queue(s), configure,
start, stop operation etc.


> +
> +struct rte_gpu_dev {
> +       /* Backing device. */
> +       struct rte_device *device;

See above?

> +       /* GPU info structure. */