>> Subject: [dpdk-dev] [PATCH v4 05/10] examples/l2fwd-event: add >eventdev >> queue and port setup >> >> From: Pavan Nikhilesh <pbhagavat...@marvell.com> >> >> Add event device queue and port setup based on event eth Tx >adapter >> capabilities. >> >> Signed-off-by: Sunil Kumar Kori <sk...@marvell.com> >> Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com> >> --- >> examples/l2fwd-event/l2fwd_eventdev.c | 10 + >> examples/l2fwd-event/l2fwd_eventdev.h | 18 ++ >> examples/l2fwd-event/l2fwd_eventdev_generic.c | 179 >> +++++++++++++++++- >> .../l2fwd_eventdev_internal_port.c | 173 ++++++++++++++++- >> 4 files changed, 378 insertions(+), 2 deletions(-) >> > ><snip> > >> diff --git a/examples/l2fwd-event/l2fwd_eventdev_generic.c >> b/examples/l2fwd-event/l2fwd_eventdev_generic.c >> index e3990f8b0..65166fded 100644 >> --- a/examples/l2fwd-event/l2fwd_eventdev_generic.c >> +++ b/examples/l2fwd-event/l2fwd_eventdev_generic.c >> @@ -17,8 +17,185 @@ >> #include "l2fwd_common.h" >> #include "l2fwd_eventdev.h" >> >> +static uint32_t >> +eventdev_setup_generic(uint16_t ethdev_count) >> +{ >> + struct eventdev_resources *eventdev_rsrc = >get_eventdev_rsrc(); >> + struct rte_event_dev_config event_d_conf = { >> + .nb_events_limit = 4096, >> + .nb_event_queue_flows = 1024, >> + .nb_event_port_dequeue_depth = 128, >> + .nb_event_port_enqueue_depth = 128 >> + }; >> + struct rte_event_dev_info dev_info; >> + const uint8_t event_d_id = 0; /* Always use first event device >only */ >> + uint32_t event_queue_cfg = 0; >> + uint16_t num_workers = 0; >> + int ret; >> + >> + /* Event device configurtion */ >> + rte_event_dev_info_get(event_d_id, &dev_info); >> + eventdev_rsrc->disable_implicit_release >> = !!(dev_info.event_dev_cap & >> + >> RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE); >> + >> + if (dev_info.event_dev_cap & >> RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES) >> + event_queue_cfg |= >RTE_EVENT_QUEUE_CFG_ALL_TYPES; >> + >> + /* One queue for each ethdev port + one Tx adapter Single link >> queue. */ >> + event_d_conf.nb_event_queues = ethdev_count + 1; > >It may not be true that max event queues are always more than >ethdev_count. >Please use event_d_conf.nb_event_queues as 1, in case ' >ethdev_count + 1' is more than >max event queues.
See below. This will also require change in >'event_queue_setup_generic' API where >this parameter is being used. I will fix this in v5. > >> + if (dev_info.max_event_queues < >event_d_conf.nb_event_queues) >> + event_d_conf.nb_event_queues = >> dev_info.max_event_queues; >> + The above check would make .nb_event_queues to 1. >