1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (C) 2020 Marvell International Ltd.
4 #ifndef _EVENT_HELPER_H_
5 #define _EVENT_HELPER_H_
9 #define RTE_LOGTYPE_EH RTE_LOGTYPE_USER4
11 #define EH_LOG_ERR(...) \
13 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
14 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))
16 /* Max event devices supported */
17 #define EVENT_MODE_MAX_EVENT_DEVS RTE_EVENT_MAX_DEVS
20 * Packet transfer mode of the application
22 enum eh_pkt_transfer_mode {
23 EH_PKT_TRANSFER_MODE_POLL = 0,
24 EH_PKT_TRANSFER_MODE_EVENT,
27 /* Event dev params */
28 struct eventdev_params {
30 uint8_t nb_eventqueue;
32 uint8_t ev_queue_mode;
35 /* Eventmode conf data */
36 struct eventmode_conf {
38 /**< No of event devs */
39 struct eventdev_params eventdev_config[EVENT_MODE_MAX_EVENT_DEVS];
40 /**< Per event dev conf */
44 uint64_t sched_type : 2;
49 /**< 64 bit field to specify extended params */
53 * Event helper configuration
56 enum eh_pkt_transfer_mode mode;
57 /**< Packet transfer mode of the application */
58 uint32_t eth_portmask;
60 * Mask of the eth ports to be used. This portmask would be
61 * checked while initializing devices using helper routines.
64 /**< Mode specific parameters */
68 * Initialize event mode devices
70 * Application can call this function to get the event devices, eth devices
71 * and eth rx & tx adapters initialized according to the default config or
72 * config populated using the command line args.
74 * Application is expected to initialize the eth devices and then the event
75 * mode helper subsystem will stop & start eth devices according to its
76 * requirement. Call to this function should be done after the eth devices
77 * are successfully initialized.
80 * Event helper configuration
86 eh_devs_init(struct eh_conf *conf);
89 * Release event mode devices
91 * Application can call this function to release event devices,
92 * eth rx & tx adapters according to the config.
94 * Call to this function should be done before application stops
95 * and closes eth devices. This function will not close and stop
99 * Event helper configuration
105 eh_devs_uninit(struct eh_conf *conf);
107 #endif /* _EVENT_HELPER_H_ */