DPDK  18.02.2
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 
38 };
39 
40 #define RTE_INTR_EVENT_ADD 1UL
41 #define RTE_INTR_EVENT_DEL 2UL
42 
43 typedef void (*rte_intr_event_cb_t)(int fd, void *arg);
44 
45 struct rte_epoll_data {
46  uint32_t event;
47  void *data;
48  rte_intr_event_cb_t cb_fun;
49  void *cb_arg;
50 };
51 
52 enum {
53  RTE_EPOLL_INVALID = 0,
54  RTE_EPOLL_VALID,
55  RTE_EPOLL_EXEC,
56 };
57 
60  volatile uint32_t status;
61  int fd;
62  int epfd;
63  struct rte_epoll_data epdata;
64 };
65 
69  union {
71  int uio_cfg_fd;
72  };
73  int fd;
75  uint32_t max_intr;
76  uint32_t nb_efd;
77  uint8_t efd_counter_size;
78  int efds[RTE_MAX_RXTX_INTR_VEC_ID];
79  struct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID];
81  int *intr_vec;
82 };
83 
84 #define RTE_EPOLL_PER_THREAD -1
102 int
103 rte_epoll_wait(int epfd, struct rte_epoll_event *events,
104  int maxevents, int timeout);
105 
123 int
124 rte_epoll_ctl(int epfd, int op, int fd,
125  struct rte_epoll_event *event);
126 
133 int
134 rte_intr_tls_epfd(void);
135 
152 int
153 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
154  int epfd, int op, unsigned int vec, void *data);
155 
162 void
163 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
164 
179 int
180 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
181 
189 void
190 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
191 
198 int
199 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
200 
208 int
209 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
210 
218 int
219 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
220 
221 #endif /* _RTE_EAL_INTERRUPTS_H_ */