net/ice: fix memory leak when releasing VSI
[dpdk.git] / examples / l2fwd-event / l2fwd_event.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2019 Marvell International Ltd.
3  */
4
5 #ifndef __L2FWD_EVENT_H__
6 #define __L2FWD_EVENT_H__
7
8 #include <rte_common.h>
9 #include <rte_event_eth_rx_adapter.h>
10 #include <rte_event_eth_tx_adapter.h>
11 #include <rte_mbuf.h>
12 #include <rte_spinlock.h>
13
14 #include "l2fwd_common.h"
15
16 typedef uint32_t (*event_device_setup_cb)(struct l2fwd_resources *rsrc);
17 typedef void (*event_port_setup_cb)(struct l2fwd_resources *rsrc);
18 typedef void (*event_queue_setup_cb)(struct l2fwd_resources *rsrc,
19                                      uint32_t event_queue_cfg);
20 typedef void (*adapter_setup_cb)(struct l2fwd_resources *rsrc);
21 typedef void (*event_loop_cb)(struct l2fwd_resources *rsrc);
22
23 struct event_queues {
24         uint8_t *event_q_id;
25         uint8_t nb_queues;
26 };
27
28 struct event_ports {
29         uint8_t *event_p_id;
30         uint8_t nb_ports;
31         rte_spinlock_t lock;
32 };
33
34 struct event_rx_adptr {
35         uint32_t service_id;
36         uint8_t nb_rx_adptr;
37         uint8_t *rx_adptr;
38 };
39
40 struct event_tx_adptr {
41         uint32_t service_id;
42         uint8_t nb_tx_adptr;
43         uint8_t *tx_adptr;
44 };
45
46 struct event_setup_ops {
47         event_device_setup_cb event_device_setup;
48         event_queue_setup_cb event_queue_setup;
49         event_port_setup_cb event_port_setup;
50         adapter_setup_cb adapter_setup;
51         event_loop_cb l2fwd_event_loop;
52 };
53
54 struct l2fwd_event_resources {
55         uint8_t tx_mode_q;
56         uint8_t deq_depth;
57         uint8_t has_burst;
58         uint8_t event_d_id;
59         uint8_t disable_implicit_release;
60         struct event_ports evp;
61         struct event_queues evq;
62         struct event_setup_ops ops;
63         struct event_rx_adptr rx_adptr;
64         struct event_tx_adptr tx_adptr;
65         struct rte_event_port_conf def_p_conf;
66 };
67
68 void l2fwd_event_resource_setup(struct l2fwd_resources *rsrc);
69 void l2fwd_event_set_generic_ops(struct event_setup_ops *ops);
70 void l2fwd_event_set_internal_port_ops(struct event_setup_ops *ops);
71 void l2fwd_event_service_setup(struct l2fwd_resources *rsrc);
72
73 #endif /* __L2FWD_EVENT_H__ */