> From: Jerin Jacob <jerinjacobk@gmail.com>

> Date: Thursday, 18 November 2021 at 07:17

> To: Elena Agostini <eagostini@nvidia.com>

> Cc: dpdk-dev <dev@dpdk.org>

> Subject: Re: [PATCH v1 1/1] app/test-gpudev: introduce ethdev to rx/tx packets using GPU memory

> External email: Use caution opening links or attachments>

>

 

> On Thu, Nov 18, 2021 at 12:28 AM <eagostini@nvidia.com> wrote:

> >

> > From: Elena Agostini <eagostini@nvidia.com>

> >

> > This patch introduces ethdev in test-gpudev app to provide:

> > - an example to show how GPU memory can be used to send and receive packets

> > - an useful tool to measure network metrics when using GPU memory with

> > io forwarding

> >

> > With this feature test-gpudev can:

> > - RX packets in CPU or GPU memory

> > - Store packets in the gpudev communication list

> > - TX receive packets from the communication list

> >

> > It's a simulation of a multi-core application.

> >

> > Signed-off-by: Elena Agostini <eagostini@nvidia.com>

> > ---

> >  app/test-gpudev/main.c | 471 +++++++++++++++++++++++++++++++++++++++--

> >  1 file changed, 452 insertions(+), 19 deletions(-)

> >

> > diff --git a/app/test-gpudev/main.c b/app/test-gpudev/main.c

> > index 250fba6427..daa586c64e 100644

> > --- a/app/test-gpudev/main.c

> > +++ b/app/test-gpudev/main.c

> > @@ -10,6 +10,8 @@

> >  #include <stdarg.h>

> >  #include <errno.h>

> >  #include <getopt.h>

> > +#include <stdbool.h>

> > +#include <signal.h>

> >

> >  #include <rte_common.h>

> >  #include <rte_malloc.h>

> > @@ -19,22 +21,98 @@

> >  #include <rte_ethdev.h>

> >  #include <rte_mempool.h>

> >  #include <rte_mbuf.h>

> > +#include <rte_launch.h>

> > +#include <rte_lcore.h>

> > +#include <rte_per_lcore.h>

> >

> >  #include <rte_gpudev.h>

> >

> > +#ifndef ACCESS_ONCE

> > +#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&x)

> > +#endif

> > +

> > +#ifndef WRITE_ONCE

> > +#define WRITE_ONCE(x, v) (ACCESS_ONCE(x) = (v))

> > +#endif>

 

> Better to have a public version of this macro as it uses just in this

> test application.

 

Thanks for taking time to review this patch.

I can actually use the RTE_GPU_VOLATILE macro exposed in the gpudev library

to replace both of them.