> -----Original Message-----
> From: dev <dev-boun...@dpdk.org> On Behalf Of
> pbhagavat...@marvell.com
> Sent: Thursday, October 3, 2019 2:28 AM
> To: jer...@marvell.com; bruce.richard...@intel.com; Akhil Goyal
> <akhil.go...@nxp.com>; Marko Kovacevic <marko.kovace...@intel.com>;
> Ori Kam <or...@mellanox.com>; Radu Nicolau <radu.nico...@intel.com>;
> Tomasz Kantecki <tomasz.kante...@intel.com>; Sunil Kumar Kori
> <sk...@marvell.com>; Pavan Nikhilesh <pbhagavat...@marvell.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v5 02/10] examples/l2fwd-event: add infra for
> eventdev
>
> From: Pavan Nikhilesh <pbhagavat...@marvell.com>
>
> Add infra to select event device as a mode to process packets through
> command line arguments. Also, allow the user to select the schedule type
> to be either RTE_SCHED_TYPE_ORDERED or RTE_SCHED_TYPE_ATOMIC.
>
> Usage:
>
> `--mode="eventdev"` or `--mode="poll"`
> `--eventq-sched="ordered"` or `--eventq-sched="atomic"`
>
> Signed-off-by: Sunil Kumar Kori <sk...@marvell.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com>
> ---
> examples/l2fwd-event/Makefile | 1 +
> examples/l2fwd-event/l2fwd_common.h | 3 ++
> examples/l2fwd-event/l2fwd_event.c | 34 ++++++++++++++++++++
> examples/l2fwd-event/l2fwd_event.h | 21 ++++++++++++
> examples/l2fwd-event/main.c | 50 +++++++++++++++++++++++++++--
> examples/l2fwd-event/meson.build | 1 +
> 6 files changed, 108 insertions(+), 2 deletions(-)
> create mode 100644 examples/l2fwd-event/l2fwd_event.c
> create mode 100644 examples/l2fwd-event/l2fwd_event.h
>
<snip>
> index 887a979d5..01b1d531d 100644
> --- a/examples/l2fwd-event/main.c
> +++ b/examples/l2fwd-event/main.c
> @@ -2,6 +2,7 @@
> * Copyright(C) 2019 Marvell International Ltd.
> */
>
> +#include "l2fwd_event.h"
> #include "l2fwd_poll.h"
>
> /* display usage */
> @@ -16,7 +17,12 @@ l2fwd_event_usage(const char *prgname)
> " --[no-]mac-updating: Enable or disable MAC addresses
> updating (enabled by default)\n"
> " When enabled:\n"
> " - The source MAC address is replaced by the TX port MAC
> address\n"
> - " - The destination MAC address is replaced by
> 02:00:00:00:00:TX_PORT_ID\n",
> + " - The destination MAC address is replaced by
> 02:00:00:00:00:TX_PORT_ID\n"
> + " --mode: Packet transfer mode for I/O, poll or eventdev\n"
> + " Default mode = eventdev\n"
> + " --eventq-sched: Event queue schedule type, ordered or
> atomic.\n"
> + " Default: atomic\n"
> + " Valid only if --mode=eventdev\n\n",
> prgname);
Please also add parallel mode for completeness.
> }
>
> @@ -71,6 +77,26 @@ l2fwd_event_parse_timer_period(const char *q_arg)
> return n;
> }
>
> +static void
> +l2fwd_event_parse_mode(const char *optarg,
> + struct l2fwd_resources *l2fwd_rsrc)
> +{
> + if (!strncmp(optarg, "poll", 4))
> + l2fwd_rsrc->event_mode = false;
> + else if (!strncmp(optarg, "eventdev", 8))
> + l2fwd_rsrc->event_mode = true;
> +}
> +
> +static void
> +l2fwd_event_parse_eventq_sched(const char *optarg,
> + struct l2fwd_resources *l2fwd_rsrc)
> +{
> + if (!strncmp(optarg, "ordered", 7))
> + l2fwd_rsrc->sched_type = RTE_SCHED_TYPE_ORDERED;
> + else if (!strncmp(optarg, "atomic", 6))
> + l2fwd_rsrc->sched_type = RTE_SCHED_TYPE_ATOMIC;
> +}
> +
> static const char short_options[] =
> "p:" /* portmask */
> "q:" /* number of queues */
> @@ -79,6 +105,8 @@ static const char short_options[] =
>