DPDK  21.11.7-rc1
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 __rte_experimental
125 int
126 rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
127  rte_intr_callback_fn cb_fn, void *cb_arg,
129 
150 __rte_experimental
151 int
152 rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle,
153  rte_intr_callback_fn cb, void *cb_arg);
154 
165 int rte_intr_enable(const struct rte_intr_handle *intr_handle);
166 
177 int rte_intr_disable(const struct rte_intr_handle *intr_handle);
178 
196 __rte_experimental
197 int rte_intr_ack(const struct rte_intr_handle *intr_handle);
198 
209 __rte_experimental
210 int
211 rte_thread_is_intr(void);
212 
234 __rte_experimental
235 struct rte_intr_handle *
236 rte_intr_instance_alloc(uint32_t flags);
237 
249 __rte_experimental
250 void
251 rte_intr_instance_free(struct rte_intr_handle *intr_handle);
252 
269 __rte_experimental
270 int
271 rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);
272 
286 __rte_experimental
287 int
288 rte_intr_fd_get(const struct rte_intr_handle *intr_handle);
289 
306 __rte_experimental
307 int
308 rte_intr_type_set(struct rte_intr_handle *intr_handle,
309  enum rte_intr_handle_type type);
310 
324 __rte_experimental
326 rte_intr_type_get(const struct rte_intr_handle *intr_handle);
327 
335 __rte_internal
336 int
337 rte_intr_tls_epfd(void);
338 
356 __rte_internal
357 int
358 rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
359  int epfd, int op, unsigned int vec, void *data);
360 
368 __rte_internal
369 void
370 rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
371 
387 __rte_internal
388 int
389 rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
390 
399 __rte_internal
400 void
401 rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
402 
410 __rte_internal
411 int
412 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
413 
422 __rte_internal
423 int
424 rte_intr_allow_others(struct rte_intr_handle *intr_handle);
425 
434 __rte_internal
435 int
436 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
437 
449 __rte_internal
450 struct rte_intr_handle *
451 rte_intr_instance_dup(const struct rte_intr_handle *src);
452 
467 __rte_internal
468 int
469 rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
470 
482 __rte_internal
483 int
484 rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
485 
500 __rte_internal
501 int
502 rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
503 
515 __rte_internal
516 int
517 rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
518 
533 __rte_internal
534 int
535 rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
536 
549 __rte_internal
550 int
551 rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
552 
569 __rte_internal
570 int
571 rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
572 
587 __rte_internal
588 int
589 rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
590  uint8_t efd_counter_size);
591 
604 __rte_internal
605 int
606 rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
607 
623 __rte_internal
624 int
625 rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
626 
640 __rte_internal
641 int
642 rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
643 
660 __rte_internal
661 int
662 rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
663  struct rte_epoll_event elist);
664 
679 __rte_internal
680 struct rte_epoll_event *
681 rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
682 
699 __rte_internal
700 int
701 rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
702  int size);
703 
720 __rte_internal
721 int
722 rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
723  int vec);
724 
738 __rte_internal
739 int
740 rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
741  int index);
742 
754 __rte_internal
755 void
756 rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
757 
776 __rte_internal
777 int
778 rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
779 
791 __rte_internal
792 void *
793 rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
794 
808 __rte_internal
809 int
810 rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
811  void *windows_handle);
812 
813 #ifdef __cplusplus
814 }
815 #endif
816 
817 #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 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)
__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)
__rte_experimental int rte_intr_ack(const struct rte_intr_handle *intr_handle)
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)
__rte_experimental int rte_thread_is_intr(void)
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)
__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_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)