DPDK 26.11.0-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
23extern "C" {
24#endif
25
27struct rte_intr_handle;
28
34#define RTE_INTR_INSTANCE_F_PRIVATE UINT32_C(0)
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)
64};
65
67typedef void (*rte_intr_callback_fn)(void *cb_arg);
68
73typedef void (*rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle,
74 void *cb_arg);
75
90int rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
91 rte_intr_callback_fn cb, void *cb_arg);
92
108int rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
109 rte_intr_callback_fn cb, void *cb_arg);
110
130int
131rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
132 rte_intr_callback_fn cb_fn, void *cb_arg,
134
152int
153rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle,
154 rte_intr_callback_fn cb, void *cb_arg);
155
166int rte_intr_enable(const struct rte_intr_handle *intr_handle);
167
178int rte_intr_disable(const struct rte_intr_handle *intr_handle);
179
194int rte_intr_ack(const struct rte_intr_handle *intr_handle);
195
204
217__rte_internal
218uint32_t rte_intr_active_events_flags(void);
219
240struct rte_intr_handle *
242
250void
251rte_intr_instance_free(struct rte_intr_handle *intr_handle);
252
266int
267rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);
268
279int
280rte_intr_fd_get(const struct rte_intr_handle *intr_handle);
281
291__rte_experimental
292void
293rte_intr_fd_close(struct rte_intr_handle *intr_handle);
294
308int
309rte_intr_type_set(struct rte_intr_handle *intr_handle,
310 enum rte_intr_handle_type type);
311
323rte_intr_type_get(const struct rte_intr_handle *intr_handle);
324
332__rte_internal
333int
334rte_intr_tls_epfd(void);
335
353__rte_internal
354int
355rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
356 int epfd, int op, unsigned int vec, void *data);
357
365__rte_internal
366void
367rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
368
384__rte_internal
385int
386rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
387
396__rte_internal
397void
398rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
399
407__rte_internal
408int
409rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
410
419__rte_internal
420int
421rte_intr_allow_others(struct rte_intr_handle *intr_handle);
422
431__rte_internal
432int
433rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
434
446__rte_internal
447struct rte_intr_handle *
448rte_intr_instance_dup(const struct rte_intr_handle *src);
449
464__rte_internal
465int
466rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
467
479__rte_internal
480int
481rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
482
493__rte_internal
494void
495rte_intr_dev_fd_close(struct rte_intr_handle *intr_handle);
496
511__rte_internal
512int
513rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
514
526__rte_internal
527int
528rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
529
544__rte_internal
545int
546rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
547
560__rte_internal
561int
562rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
563
580__rte_internal
581int
582rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
583
598__rte_internal
599int
600rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
601 uint8_t efd_counter_size);
602
615__rte_internal
616int
617rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
618
634__rte_internal
635int
636rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
637
651__rte_internal
652int
653rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
654
671__rte_internal
672int
673rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
674 struct rte_epoll_event elist);
675
690__rte_internal
691struct rte_epoll_event *
692rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
693
710__rte_internal
711int
712rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
713 int size);
714
731__rte_internal
732int
733rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
734 int vec);
735
749__rte_internal
750int
751rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
752 int index);
753
765__rte_internal
766void
767rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
768
787__rte_internal
788int
789rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
790
802__rte_internal
803void *
804rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
805
819__rte_internal
820int
821rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
822 void *windows_handle);
823
824#ifdef __cplusplus
825}
826#endif
827
828#endif
int rte_intr_disable(const struct rte_intr_handle *intr_handle)
void rte_intr_instance_free(struct rte_intr_handle *intr_handle)
enum rte_intr_handle_type rte_intr_type_get(const struct rte_intr_handle *intr_handle)
void(* rte_intr_callback_fn)(void *cb_arg)
int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd)
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_type_set(struct rte_intr_handle *intr_handle, enum rte_intr_handle_type type)
int rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
int rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
rte_intr_handle_type
@ RTE_INTR_HANDLE_EXT
@ RTE_INTR_HANDLE_UNKNOWN
@ RTE_INTR_HANDLE_MAX
@ RTE_INTR_HANDLE_VFIO_LEGACY
@ RTE_INTR_HANDLE_DEV_EVENT
@ RTE_INTR_HANDLE_UIO_INTX
@ RTE_INTR_HANDLE_UIO
@ RTE_INTR_HANDLE_VFIO_MSI
@ RTE_INTR_HANDLE_VDEV
@ RTE_INTR_HANDLE_VFIO_MSIX
@ RTE_INTR_HANDLE_VFIO_REQ
@ RTE_INTR_HANDLE_ALARM
struct rte_intr_handle * rte_intr_instance_alloc(uint32_t flags)
int rte_intr_fd_get(const 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)
void(* rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle, void *cb_arg)
__rte_experimental void rte_intr_fd_close(struct rte_intr_handle *intr_handle)
int rte_thread_is_intr(void)
int rte_intr_ack(const struct rte_intr_handle *intr_handle)
int rte_intr_enable(const struct rte_intr_handle *intr_handle)