DPDK  24.11.6
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 
43 #define RTE_INTR_EVENT_IN RTE_BIT32(0)
44 #define RTE_INTR_EVENT_ERR RTE_BIT32(1)
45 #define RTE_INTR_EVENT_HUP RTE_BIT32(2)
46 #define RTE_INTR_EVENT_RDHUP RTE_BIT32(3)
51 enum rte_intr_handle_type {
64 };
65 
67 typedef void (*rte_intr_callback_fn)(void *cb_arg);
68 
73 typedef void (*rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle,
74  void *cb_arg);
75 
90 int rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
91  rte_intr_callback_fn cb, void *cb_arg);
92 
108 int rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
109  rte_intr_callback_fn cb, void *cb_arg);
110 
130 int
131 rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
132  rte_intr_callback_fn cb_fn, void *cb_arg,
134 
152 int
153 rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle,
154  rte_intr_callback_fn cb, void *cb_arg);
155 
166 int rte_intr_enable(const struct rte_intr_handle *intr_handle);
167 
178 int rte_intr_disable(const struct rte_intr_handle *intr_handle);
179 
194 int rte_intr_ack(const struct rte_intr_handle *intr_handle);
195 
203 int rte_thread_is_intr(void);
204 
217 __rte_internal
218 uint32_t rte_intr_active_events_flags(void);
219 
238 struct rte_intr_handle *
239 rte_intr_instance_alloc(uint32_t flags);
240 
248 void
249 rte_intr_instance_free(struct rte_intr_handle *intr_handle);
250 
264 int
265 rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);
266 
277 int
278 rte_intr_fd_get(const struct rte_intr_handle *intr_handle);
279 
293 int
294 rte_intr_type_set(struct rte_intr_handle *intr_handle,
295  enum rte_intr_handle_type type);
296 
308 rte_intr_type_get(const struct rte_intr_handle *intr_handle);
309 
317 __rte_internal
318 int
319 rte_intr_tls_epfd(void);
320 
338 __rte_internal
339 int
340 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
341  int epfd, int op, unsigned int vec, void *data);
342 
350 __rte_internal
351 void
352 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
353 
369 __rte_internal
370 int
371 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
372 
381 __rte_internal
382 void
383 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
384 
392 __rte_internal
393 int
394 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
395 
404 __rte_internal
405 int
406 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
407 
416 __rte_internal
417 int
418 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
419 
431 __rte_internal
432 struct rte_intr_handle *
433 rte_intr_instance_dup(const struct rte_intr_handle *src);
434 
449 __rte_internal
450 int
451 rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
452 
464 __rte_internal
465 int
466 rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
467 
482 __rte_internal
483 int
484 rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
485 
497 __rte_internal
498 int
499 rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
500 
515 __rte_internal
516 int
517 rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
518 
531 __rte_internal
532 int
533 rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
534 
551 __rte_internal
552 int
553 rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
554 
569 __rte_internal
570 int
571 rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
572  uint8_t efd_counter_size);
573 
586 __rte_internal
587 int
588 rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
589 
605 __rte_internal
606 int
607 rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
608 
622 __rte_internal
623 int
624 rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
625 
642 __rte_internal
643 int
644 rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
645  struct rte_epoll_event elist);
646 
661 __rte_internal
662 struct rte_epoll_event *
663 rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
664 
681 __rte_internal
682 int
683 rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
684  int size);
685 
702 __rte_internal
703 int
704 rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
705  int vec);
706 
720 __rte_internal
721 int
722 rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
723  int index);
724 
736 __rte_internal
737 void
738 rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
739 
758 __rte_internal
759 int
760 rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
761 
773 __rte_internal
774 void *
775 rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
776 
790 __rte_internal
791 int
792 rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
793  void *windows_handle);
794 
795 #ifdef __cplusplus
796 }
797 #endif
798 
799 #endif
void rte_intr_instance_free(struct rte_intr_handle *intr_handle)
int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd)
int rte_intr_callback_register(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
rte_intr_handle_type
struct rte_intr_handle * rte_intr_instance_alloc(uint32_t flags)
int rte_intr_disable(const struct rte_intr_handle *intr_handle)
int rte_intr_type_set(struct rte_intr_handle *intr_handle, enum rte_intr_handle_type type)
int rte_thread_is_intr(void)
void(* rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle, void *cb_arg)
int rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
void(* rte_intr_callback_fn)(void *cb_arg)
int rte_intr_ack(const struct rte_intr_handle *intr_handle)
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_fd_get(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)
enum rte_intr_handle_type rte_intr_type_get(const struct rte_intr_handle *intr_handle)