DPDK  22.07.0
rte_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 #define _RTE_INTERRUPTS_H_
7 
8 #include <stdbool.h>
9 
10 #include <rte_bitops.h>
11 #include <rte_common.h>
12 #include <rte_compat.h>
13 #include <rte_epoll.h>
14 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
27 struct rte_intr_handle;
28 
34 #define RTE_INTR_INSTANCE_F_PRIVATE UINT32_C(0)
35 
36 #define RTE_INTR_INSTANCE_F_SHARED RTE_BIT32(0)
37 
38 #define RTE_MAX_RXTX_INTR_VEC_ID 512
39 #define RTE_INTR_VEC_ZERO_OFFSET 0
40 #define RTE_INTR_VEC_RXTX_OFFSET 1
41 
58 };
59 
61 typedef void (*rte_intr_callback_fn)(void *cb_arg);
62 
67 typedef void (*rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle,
68  void *cb_arg);
69 
84 int rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
85  rte_intr_callback_fn cb, void *cb_arg);
86 
102 int rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
103  rte_intr_callback_fn cb, void *cb_arg);
104 
124 int
125 rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
126  rte_intr_callback_fn cb_fn, void *cb_arg,
128 
149 __rte_experimental
150 int
151 rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle,
152  rte_intr_callback_fn cb, void *cb_arg);
153 
164 int rte_intr_enable(const struct rte_intr_handle *intr_handle);
165 
176 int rte_intr_disable(const struct rte_intr_handle *intr_handle);
177 
192 int rte_intr_ack(const struct rte_intr_handle *intr_handle);
193 
201 int rte_thread_is_intr(void);
202 
224 __rte_experimental
225 struct rte_intr_handle *
226 rte_intr_instance_alloc(uint32_t flags);
227 
239 __rte_experimental
240 void
241 rte_intr_instance_free(struct rte_intr_handle *intr_handle);
242 
259 __rte_experimental
260 int
261 rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);
262 
276 __rte_experimental
277 int
278 rte_intr_fd_get(const struct rte_intr_handle *intr_handle);
279 
296 __rte_experimental
297 int
298 rte_intr_type_set(struct rte_intr_handle *intr_handle,
299  enum rte_intr_handle_type type);
300 
314 __rte_experimental
316 rte_intr_type_get(const struct rte_intr_handle *intr_handle);
317 
325 __rte_internal
326 int
327 rte_intr_tls_epfd(void);
328 
346 __rte_internal
347 int
348 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
349  int epfd, int op, unsigned int vec, void *data);
350 
358 __rte_internal
359 void
360 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
361 
377 __rte_internal
378 int
379 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
380 
389 __rte_internal
390 void
391 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
392 
400 __rte_internal
401 int
402 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
403 
412 __rte_internal
413 int
414 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
415 
424 __rte_internal
425 int
426 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
427 
439 __rte_internal
440 struct rte_intr_handle *
441 rte_intr_instance_dup(const struct rte_intr_handle *src);
442 
457 __rte_internal
458 int
459 rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
460 
472 __rte_internal
473 int
474 rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
475 
490 __rte_internal
491 int
492 rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
493 
505 __rte_internal
506 int
507 rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
508 
523 __rte_internal
524 int
525 rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
526 
539 __rte_internal
540 int
541 rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
542 
559 __rte_internal
560 int
561 rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
562 
577 __rte_internal
578 int
579 rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
580  uint8_t efd_counter_size);
581 
594 __rte_internal
595 int
596 rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
597 
613 __rte_internal
614 int
615 rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
616 
630 __rte_internal
631 int
632 rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
633 
650 __rte_internal
651 int
652 rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
653  struct rte_epoll_event elist);
654 
669 __rte_internal
670 struct rte_epoll_event *
671 rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
672 
689 __rte_internal
690 int
691 rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
692  int size);
693 
710 __rte_internal
711 int
712 rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
713  int vec);
714 
728 __rte_internal
729 int
730 rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
731  int index);
732 
744 __rte_internal
745 void
746 rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
747 
766 __rte_internal
767 int
768 rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
769 
781 __rte_internal
782 void *
783 rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
784 
798 __rte_internal
799 int
800 rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
801  void *windows_handle);
802 
803 #ifdef __cplusplus
804 }
805 #endif
806 
807 #endif
__rte_experimental int rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
__rte_experimental void rte_intr_instance_free(struct rte_intr_handle *intr_handle)
int rte_intr_callback_register(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
rte_intr_handle_type
int rte_intr_disable(const struct rte_intr_handle *intr_handle)
int rte_thread_is_intr(void)
void(* rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle, void *cb_arg)
__rte_experimental int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd)
void(* rte_intr_callback_fn)(void *cb_arg)
__rte_experimental int rte_intr_fd_get(const struct rte_intr_handle *intr_handle)
__rte_experimental enum rte_intr_handle_type rte_intr_type_get(const struct rte_intr_handle *intr_handle)
int rte_intr_ack(const struct rte_intr_handle *intr_handle)
__rte_experimental int rte_intr_type_set(struct rte_intr_handle *intr_handle, enum rte_intr_handle_type type)
__rte_experimental struct rte_intr_handle * rte_intr_instance_alloc(uint32_t flags)
int rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb_fn, void *cb_arg, rte_intr_unregister_callback_fn ucb_fn)
int rte_intr_enable(const struct rte_intr_handle *intr_handle)
int rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)