DPDK  24.03.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 
146 int
147 rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle,
148  rte_intr_callback_fn cb, void *cb_arg);
149 
160 int rte_intr_enable(const struct rte_intr_handle *intr_handle);
161 
172 int rte_intr_disable(const struct rte_intr_handle *intr_handle);
173 
188 int rte_intr_ack(const struct rte_intr_handle *intr_handle);
189 
197 int rte_thread_is_intr(void);
198 
217 struct rte_intr_handle *
218 rte_intr_instance_alloc(uint32_t flags);
219 
227 void
228 rte_intr_instance_free(struct rte_intr_handle *intr_handle);
229 
243 int
244 rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);
245 
256 int
257 rte_intr_fd_get(const struct rte_intr_handle *intr_handle);
258 
272 int
273 rte_intr_type_set(struct rte_intr_handle *intr_handle,
274  enum rte_intr_handle_type type);
275 
287 rte_intr_type_get(const struct rte_intr_handle *intr_handle);
288 
296 __rte_internal
297 int
298 rte_intr_tls_epfd(void);
299 
317 __rte_internal
318 int
319 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
320  int epfd, int op, unsigned int vec, void *data);
321 
329 __rte_internal
330 void
331 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
332 
348 __rte_internal
349 int
350 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
351 
360 __rte_internal
361 void
362 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
363 
371 __rte_internal
372 int
373 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
374 
383 __rte_internal
384 int
385 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
386 
395 __rte_internal
396 int
397 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
398 
410 __rte_internal
411 struct rte_intr_handle *
412 rte_intr_instance_dup(const struct rte_intr_handle *src);
413 
428 __rte_internal
429 int
430 rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
431 
443 __rte_internal
444 int
445 rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
446 
461 __rte_internal
462 int
463 rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
464 
476 __rte_internal
477 int
478 rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
479 
494 __rte_internal
495 int
496 rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
497 
510 __rte_internal
511 int
512 rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
513 
530 __rte_internal
531 int
532 rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
533 
548 __rte_internal
549 int
550 rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
551  uint8_t efd_counter_size);
552 
565 __rte_internal
566 int
567 rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
568 
584 __rte_internal
585 int
586 rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
587 
601 __rte_internal
602 int
603 rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
604 
621 __rte_internal
622 int
623 rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
624  struct rte_epoll_event elist);
625 
640 __rte_internal
641 struct rte_epoll_event *
642 rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
643 
660 __rte_internal
661 int
662 rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
663  int size);
664 
681 __rte_internal
682 int
683 rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
684  int vec);
685 
699 __rte_internal
700 int
701 rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
702  int index);
703 
715 __rte_internal
716 void
717 rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
718 
737 __rte_internal
738 int
739 rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
740 
752 __rte_internal
753 void *
754 rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
755 
769 __rte_internal
770 int
771 rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
772  void *windows_handle);
773 
774 #ifdef __cplusplus
775 }
776 #endif
777 
778 #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)