DPDK 22.11.4
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
149__rte_experimental
150int
151rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle,
152 rte_intr_callback_fn cb, void *cb_arg);
153
164int rte_intr_enable(const struct rte_intr_handle *intr_handle);
165
176int rte_intr_disable(const struct rte_intr_handle *intr_handle);
177
192int rte_intr_ack(const struct rte_intr_handle *intr_handle);
193
202
224__rte_experimental
225struct rte_intr_handle *
227
239__rte_experimental
240void
241rte_intr_instance_free(struct rte_intr_handle *intr_handle);
242
259__rte_experimental
260int
261rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);
262
276__rte_experimental
277int
278rte_intr_fd_get(const struct rte_intr_handle *intr_handle);
279
296__rte_experimental
297int
298rte_intr_type_set(struct rte_intr_handle *intr_handle,
299 enum rte_intr_handle_type type);
300
314__rte_experimental
316rte_intr_type_get(const struct rte_intr_handle *intr_handle);
317
325__rte_internal
326int
327rte_intr_tls_epfd(void);
328
346__rte_internal
347int
348rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
349 int epfd, int op, unsigned int vec, void *data);
350
358__rte_internal
359void
360rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
361
377__rte_internal
378int
379rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
380
389__rte_internal
390void
391rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
392
400__rte_internal
401int
402rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
403
412__rte_internal
413int
414rte_intr_allow_others(struct rte_intr_handle *intr_handle);
415
424__rte_internal
425int
426rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
427
439__rte_internal
440struct rte_intr_handle *
441rte_intr_instance_dup(const struct rte_intr_handle *src);
442
457__rte_internal
458int
459rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
460
472__rte_internal
473int
474rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
475
490__rte_internal
491int
492rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
493
505__rte_internal
506int
507rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
508
523__rte_internal
524int
525rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
526
539__rte_internal
540int
541rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
542
559__rte_internal
560int
561rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
562
577__rte_internal
578int
579rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
580 uint8_t efd_counter_size);
581
594__rte_internal
595int
596rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
597
613__rte_internal
614int
615rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
616
630__rte_internal
631int
632rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
633
650__rte_internal
651int
652rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
653 struct rte_epoll_event elist);
654
669__rte_internal
670struct rte_epoll_event *
671rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
672
689__rte_internal
690int
691rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
692 int size);
693
710__rte_internal
711int
712rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
713 int vec);
714
728__rte_internal
729int
730rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
731 int index);
732
744__rte_internal
745void
746rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
747
766__rte_internal
767int
768rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
769
781__rte_internal
782void *
783rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
784
798__rte_internal
799int
800rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
801 void *windows_handle);
802
803#ifdef __cplusplus
804}
805#endif
806
807#endif
int rte_intr_disable(const struct rte_intr_handle *intr_handle)
__rte_experimental 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)
__rte_experimental void rte_intr_instance_free(struct rte_intr_handle *intr_handle)
__rte_experimental int rte_intr_fd_get(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_callback_unregister(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
__rte_experimental int rte_intr_type_set(struct rte_intr_handle *intr_handle, enum rte_intr_handle_type type)
int rte_intr_callback_register(const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
__rte_experimental int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd)
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)
__rte_experimental enum rte_intr_handle_type rte_intr_type_get(const struct rte_intr_handle *intr_handle)
__rte_experimental struct rte_intr_handle * rte_intr_instance_alloc(uint32_t flags)