[dpdk-dev] [PATCH v5 02/10] examples/l2fwd-event: add infra for eventdev

Nipun Gupta nipun.gupta at nxp.com
Fri Oct 4 14:30:06 CEST 2019



> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of
> pbhagavatula at marvell.com
> Sent: Thursday, October 3, 2019 2:28 AM
> To: jerinj at marvell.com; bruce.richardson at intel.com; Akhil Goyal
> <akhil.goyal at nxp.com>; Marko Kovacevic <marko.kovacevic at intel.com>;
> Ori Kam <orika at mellanox.com>; Radu Nicolau <radu.nicolau at intel.com>;
> Tomasz Kantecki <tomasz.kantecki at intel.com>; Sunil Kumar Kori
> <skori at marvell.com>; Pavan Nikhilesh <pbhagavatula at marvell.com>
> Cc: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v5 02/10] examples/l2fwd-event: add infra for
> eventdev
> 
> From: Pavan Nikhilesh <pbhagavatula at 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 <skori at marvell.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at 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[] =
> 


More information about the dev mailing list