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

Jerin Jacob jerinjacobk at gmail.com
Thu Sep 26 19:33:08 CEST 2019


On Tue, Sep 24, 2019 at 3:12 PM <pbhagavatula at marvell.com> wrote:
>
> From: Sunil Kumar Kori <skori 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-sync="ordered"` or `--eventq-sync="atomic"`
>
> Signed-off-by: Sunil Kumar Kori <skori at marvell.com>
> ---

>  main(int argc, char **argv)
>  {
> +       struct eventdev_resources *eventdev_rsrc;
>         uint16_t nb_ports_available = 0;
>         struct lcore_queue_conf *qconf;
>         uint32_t nb_ports_in_mask = 0;
> @@ -524,6 +548,7 @@ main(int argc, char **argv)
>         signal(SIGINT, signal_handler);
>         signal(SIGTERM, signal_handler);
>
> +       eventdev_rsrc = get_eventdev_rsrc();
>         /* parse application arguments (after the EAL ones) */
>         ret = l2fwd_parse_args(argc, argv);
>         if (ret < 0)
> @@ -584,6 +609,17 @@ main(int argc, char **argv)
>         if (l2fwd_pktmbuf_pool == NULL)
>                 rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
>
> +       eventdev_rsrc->port_mask = l2fwd_enabled_port_mask;
> +       eventdev_rsrc->pkt_pool = l2fwd_pktmbuf_pool;
> +       eventdev_rsrc->dst_ports = l2fwd_dst_ports;
> +       eventdev_rsrc->timer_period = timer_period;
> +       eventdev_rsrc->mac_updt = mac_updating;
> +       eventdev_rsrc->stats = port_statistics;
> +       eventdev_rsrc->done = &force_quit;

These resources are repeating for poll mode as well. IMO,
We can have "rsrc" object which will have variables required for this
application.(i.e poll and event mode)
to avoid code duplication.


More information about the dev mailing list