1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2019 Marvell International Ltd.
5 #ifndef __L3FWD_EVENTDEV_H__
6 #define __L3FWD_EVENTDEV_H__
8 #include <rte_common.h>
9 #include <rte_eventdev.h>
10 #include <rte_event_eth_rx_adapter.h>
11 #include <rte_event_eth_tx_adapter.h>
12 #include <rte_service.h>
13 #include <rte_spinlock.h>
17 #define L3FWD_EVENT_SINGLE 0x1
18 #define L3FWD_EVENT_BURST 0x2
19 #define L3FWD_EVENT_TX_DIRECT 0x4
20 #define L3FWD_EVENT_TX_ENQ 0x8
22 typedef uint32_t (*event_device_setup_cb)(void);
23 typedef void (*event_queue_setup_cb)(uint32_t event_queue_cfg);
24 typedef void (*event_port_setup_cb)(void);
25 typedef void (*adapter_setup_cb)(void);
26 typedef int (*event_loop_cb)(void *);
28 struct l3fwd_event_queues {
33 struct l3fwd_event_ports {
39 struct l3fwd_event_rx_adptr {
45 struct l3fwd_event_tx_adptr {
51 struct l3fwd_event_setup_ops {
52 event_device_setup_cb event_device_setup;
53 event_queue_setup_cb event_queue_setup;
54 event_port_setup_cb event_port_setup;
55 adapter_setup_cb adapter_setup;
56 event_loop_cb lpm_event_loop;
57 event_loop_cb em_event_loop;
58 event_loop_cb fib_event_loop;
61 struct l3fwd_event_resources {
62 struct rte_event_port_conf def_p_conf;
63 struct l3fwd_event_rx_adptr rx_adptr;
64 struct l3fwd_event_tx_adptr tx_adptr;
65 uint8_t disable_implicit_release;
66 struct l3fwd_event_setup_ops ops;
67 struct rte_mempool * (*pkt_pool)[NB_SOCKETS];
68 struct l3fwd_event_queues evq;
69 struct l3fwd_event_ports evp;
71 uint8_t per_port_pool;
78 uint8_t eth_rx_queues;
81 struct l3fwd_event_resources *l3fwd_get_eventdev_rsrc(void);
82 void l3fwd_event_resource_setup(struct rte_eth_conf *port_conf);
83 int l3fwd_get_free_event_port(struct l3fwd_event_resources *eventdev_rsrc);
84 void l3fwd_event_set_generic_ops(struct l3fwd_event_setup_ops *ops);
85 void l3fwd_event_set_internal_port_ops(struct l3fwd_event_setup_ops *ops);
87 #endif /* __L3FWD_EVENTDEV_H__ */