DPDK 26.11.0-rc2
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)(const 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
397__rte_internal
398void
399rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
400
408__rte_internal
409int
410rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
411
420__rte_internal
421int
422rte_intr_allow_others(struct rte_intr_handle *intr_handle);
423
432__rte_internal
433int
434rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
435
450__rte_internal
451int
452rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
453
465__rte_internal
466int
467rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
468
479__rte_internal
480void
481rte_intr_dev_fd_close(struct rte_intr_handle *intr_handle);
482
497__rte_internal
498int
499rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
500
512__rte_internal
513int
514rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
515
530__rte_internal
531int
532rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
533
546__rte_internal
547int
548rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
549
566__rte_internal
567int
568rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
569
584__rte_internal
585int
586rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
587 uint8_t efd_counter_size);
588
601__rte_internal
602int
603rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
604
624__rte_internal
625int
626rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
627
641__rte_internal
642int
643rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
644
661__rte_internal
662int
663rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
664 struct rte_epoll_event elist);
665
680__rte_internal
681struct rte_epoll_event *
682rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
683
700__rte_internal
701int
702rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
703 int size);
704
721__rte_internal
722int
723rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
724 int vec);
725
739__rte_internal
740int
741rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
742 int index);
743
755__rte_internal
756void
757rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
758
777__rte_internal
778int
779rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
780
792__rte_internal
793void *
794rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
795
809__rte_internal
810int
811rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
812 void *windows_handle);
813
814#ifdef __cplusplus
815}
816#endif
817
818#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)(const 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)