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