DPDK  18.11.11
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 
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  volatile uint32_t status;
63  int fd;
64  int epfd;
65  struct rte_epoll_data epdata;
66 };
67 
71  union {
73  int uio_cfg_fd;
74  };
75  int fd;
77  uint32_t max_intr;
78  uint32_t nb_efd;
79  uint8_t efd_counter_size;
80  int efds[RTE_MAX_RXTX_INTR_VEC_ID];
81  struct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID];
83  int *intr_vec;
84 };
85 
86 #define RTE_EPOLL_PER_THREAD -1
104 int
105 rte_epoll_wait(int epfd, struct rte_epoll_event *events,
106  int maxevents, int timeout);
107 
125 int
126 rte_epoll_ctl(int epfd, int op, int fd,
127  struct rte_epoll_event *event);
128 
135 int
136 rte_intr_tls_epfd(void);
137 
154 int
155 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
156  int epfd, int op, unsigned int vec, void *data);
157 
164 void
165 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
166 
181 int
182 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
183 
191 void
192 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
193 
200 int
201 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
202 
210 int
211 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
212 
220 int
221 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
222 
223 #endif /* _RTE_EAL_INTERRUPTS_H_ */
struct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID]
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)
int rte_epoll_ctl(int epfd, int op, int fd, struct rte_epoll_event *event)
int rte_intr_cap_multiple(struct rte_intr_handle *intr_handle)
int efds[RTE_MAX_RXTX_INTR_VEC_ID]
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:37
void rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle)
enum rte_intr_handle_type type
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)
volatile uint32_t status