DPDK  21.08.0
rte_eal_interrupts.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
5 #ifndef _RTE_INTERRUPTS_H_
6 #error "don't include this file directly, please include generic <rte_interrupts.h>"
7 #endif
8 
17 #ifndef _RTE_EAL_INTERRUPTS_H_
18 #define _RTE_EAL_INTERRUPTS_H_
19 
20 #define RTE_MAX_RXTX_INTR_VEC_ID 512
21 #define RTE_INTR_VEC_ZERO_OFFSET 0
22 #define RTE_INTR_VEC_RXTX_OFFSET 1
23 
40 };
41 
42 #define RTE_INTR_EVENT_ADD 1UL
43 #define RTE_INTR_EVENT_DEL 2UL
44 
45 typedef void (*rte_intr_event_cb_t)(int fd, void *arg);
46 
47 struct rte_epoll_data {
48  uint32_t event;
49  void *data;
50  rte_intr_event_cb_t cb_fun;
51  void *cb_arg;
52 };
53 
54 enum {
55  RTE_EPOLL_INVALID = 0,
56  RTE_EPOLL_VALID,
57  RTE_EPOLL_EXEC,
58 };
59 
62  uint32_t status;
63  int fd;
64  int epfd;
65  struct rte_epoll_data epdata;
66 };
67 
71  union {
72  struct {
74  union {
79  };
80  int fd;
81  };
82  void *handle;
83  };
85  uint32_t max_intr;
86  uint32_t nb_efd;
87  uint8_t efd_counter_size;
88  int efds[RTE_MAX_RXTX_INTR_VEC_ID];
89  struct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID];
91  int *intr_vec;
92 };
93 
94 #define RTE_EPOLL_PER_THREAD -1
113 int
114 rte_epoll_wait(int epfd, struct rte_epoll_event *events,
115  int maxevents, int timeout);
116 
134 __rte_experimental
135 int
137  int maxevents, int timeout);
138 
156 int
157 rte_epoll_ctl(int epfd, int op, int fd,
158  struct rte_epoll_event *event);
159 
166 int
167 rte_intr_tls_epfd(void);
168 
185 int
186 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
187  int epfd, int op, unsigned int vec, void *data);
188 
195 void
196 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
197 
212 int
213 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
214 
222 void
223 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
224 
231 int
232 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
233 
241 int
242 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
243 
251 int
252 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
253 
265 __rte_experimental
266 int
267 rte_thread_is_intr(void);
268 
269 #endif /* _RTE_EAL_INTERRUPTS_H_ */
int rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd, int op, unsigned int vec, void *data)
int rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd)
__rte_experimental int rte_thread_is_intr(void)
int rte_epoll_ctl(int epfd, int op, int fd, struct rte_epoll_event *event)
__rte_experimental int rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events, int maxevents, int timeout)
int rte_intr_cap_multiple(struct rte_intr_handle *intr_handle)
rte_intr_handle_type
int rte_intr_tls_epfd(void)
int rte_epoll_wait(int epfd, struct rte_epoll_event *events, int maxevents, int timeout)
#define RTE_STD_C11
Definition: rte_common.h:42
void rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle)
void rte_intr_efd_disable(struct rte_intr_handle *intr_handle)
int rte_intr_allow_others(struct rte_intr_handle *intr_handle)
int rte_intr_dp_is_en(struct rte_intr_handle *intr_handle)