DPDK 26.03.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)(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
238struct rte_intr_handle *
240
248void
249rte_intr_instance_free(struct rte_intr_handle *intr_handle);
250
264int
265rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);
266
277int
278rte_intr_fd_get(const struct rte_intr_handle *intr_handle);
279
293int
294rte_intr_type_set(struct rte_intr_handle *intr_handle,
295 enum rte_intr_handle_type type);
296
308rte_intr_type_get(const struct rte_intr_handle *intr_handle);
309
317__rte_internal
318int
319rte_intr_tls_epfd(void);
320
338__rte_internal
339int
340rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,
341 int epfd, int op, unsigned int vec, void *data);
342
350__rte_internal
351void
352rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);
353
369__rte_internal
370int
371rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);
372
381__rte_internal
382void
383rte_intr_efd_disable(struct rte_intr_handle *intr_handle);
384
392__rte_internal
393int
394rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);
395
404__rte_internal
405int
406rte_intr_allow_others(struct rte_intr_handle *intr_handle);
407
416__rte_internal
417int
418rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
419
431__rte_internal
432struct rte_intr_handle *
433rte_intr_instance_dup(const struct rte_intr_handle *src);
434
449__rte_internal
450int
451rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);
452
464__rte_internal
465int
466rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);
467
482__rte_internal
483int
484rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);
485
497__rte_internal
498int
499rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
500
515__rte_internal
516int
517rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);
518
531__rte_internal
532int
533rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);
534
551__rte_internal
552int
553rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);
554
569__rte_internal
570int
571rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,
572 uint8_t efd_counter_size);
573
586__rte_internal
587int
588rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);
589
605__rte_internal
606int
607rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);
608
622__rte_internal
623int
624rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);
625
642__rte_internal
643int
644rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,
645 struct rte_epoll_event elist);
646
661__rte_internal
662struct rte_epoll_event *
663rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);
664
681__rte_internal
682int
683rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,
684 int size);
685
702__rte_internal
703int
704rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,
705 int vec);
706
720__rte_internal
721int
722rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,
723 int index);
724
736__rte_internal
737void
738rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);
739
758__rte_internal
759int
760rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);
761
773__rte_internal
774void *
775rte_intr_instance_windows_handle_get(struct rte_intr_handle *intr_handle);
776
790__rte_internal
791int
792rte_intr_instance_windows_handle_set(struct rte_intr_handle *intr_handle,
793 void *windows_handle);
794
795#ifdef __cplusplus
796}
797#endif
798
799#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)