On Thu, Nov 18, 2021 at 12:28 AM <eagost...@nvidia.com> wrote:
>
> From: Elena Agostini <eagost...@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 <eagost...@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.

Reply via email to