> From: Jerin Jacob > Date: Thursday, 18 November 2021 at 07:17 > To: Elena Agostini > Cc: dpdk-dev > 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 wrote: > > > > From: Elena Agostini > > > > 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 > > --- > > 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 > > #include > > #include > > +#include > > +#include > > > > #include > > #include > > @@ -19,22 +21,98 @@ > > #include > > #include > > #include > > +#include > > +#include > > +#include > > > > #include > > > > +#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.