DPDK  18.05.1
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 32
21 #define RTE_INTR_VEC_ZERO_OFFSET 0
22 #define RTE_INTR_VEC_RXTX_OFFSET 1
23 
39 };
40 
41 #define RTE_INTR_EVENT_ADD 1UL
42 #define RTE_INTR_EVENT_DEL 2UL
43 
44 typedef void (*rte_intr_event_cb_t)(int fd, void *arg);
45 
46 struct rte_epoll_data {
47  uint32_t event;
48  void *data;
49  rte_intr_event_cb_t cb_fun;
50  void *cb_arg;
51 };
52 
53 enum {
54  RTE_EPOLL_INVALID = 0,
55  RTE_EPOLL_VALID,
56  RTE_EPOLL_EXEC,
57 };
58 
61  volatile uint32_t status;
62  int fd;
63  int epfd;
64  struct rte_epoll_data epdata;
65 };
66 
70  union {
72  int uio_cfg_fd;
73  };
74  int fd;
76  uint32_t max_intr;
77  uint32_t nb_efd;
78  uint8_t efd_counter_size;
79  int efds[RTE_MAX_RXTX_INTR_VEC_ID];
80  struct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID];
82  int *intr_vec;
83 };
84 
85 #define RTE_EPOLL_PER_THREAD -1
103 int
104 rte_epoll_wait(int epfd, struct rte_epoll_event *events,
105  int maxevents, int timeout);
106 
124 int
125 rte_epoll_ctl(int epfd, int op, int fd,
126  struct rte_epoll_event *event);
127 
134 int
135 rte_intr_tls_epfd(void);
136 
153 int
154 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
155  int epfd, int op, unsigned int vec, void *data);
156 
163 void
164 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
165 
180 int
181 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
182 
190 void
191 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
192 
199 int
200 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
201 
209 int
210 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
211 
219 int
220 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
221 
222 #endif /* _RTE_EAL_INTERRUPTS_H_ */