DPDK: Data Plane Development Kit

18.02.0-rc0
rte_interrupts.h File Reference
#include <rte_common.h>
#include "rte_eal_interrupts.h"

Go to the source code of this file.

Typedefs

typedef void(* rte_intr_callback_fn )(void *cb_arg)

Functions

int rte_intr_callback_register (const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
int rte_intr_callback_unregister (const struct rte_intr_handle *intr_handle, rte_intr_callback_fn cb, void *cb_arg)
int rte_intr_enable (const struct rte_intr_handle *intr_handle)
int rte_intr_disable (const struct rte_intr_handle *intr_handle)

Detailed Description

The RTE interrupt interface provides functions to register/unregister callbacks for a specific interrupt.

Definition in file rte_interrupts.h.

Typedef Documentation

typedef void(* rte_intr_callback_fn)(void *cb_arg)

Function to be registered for the specific interrupt

Definition at line 54 of file rte_interrupts.h.

Function Documentation

int rte_intr_callback_register ( const struct rte_intr_handle intr_handle,
rte_intr_callback_fn  cb,
void *  cb_arg 
)

It registers the callback for the specific interrupt. Multiple callbacks cal be registered at the same time.

Parameters
intr_handlePointer to the interrupt handle.
cbcallback address.
cb_argaddress of parameter for callback.
Returns
  • On success, zero.
  • On failure, a negative value.
int rte_intr_callback_unregister ( const struct rte_intr_handle intr_handle,
rte_intr_callback_fn  cb,
void *  cb_arg 
)

It unregisters the callback according to the specified interrupt handle.

Parameters
intr_handlepointer to the interrupt handle.
cbcallback address.
cb_argaddress of parameter for callback, (void *)-1 means to remove all registered which has the same callback address.
Returns
  • On success, return the number of callback entities removed.
  • On failure, a negative value.
int rte_intr_enable ( const struct rte_intr_handle intr_handle)

It enables the interrupt for the specified handle.

Parameters
intr_handlepointer to the interrupt handle.
Returns
  • On success, zero.
  • On failure, a negative value.
int rte_intr_disable ( const struct rte_intr_handle intr_handle)

It disables the interrupt for the specified handle.

Parameters
intr_handlepointer to the interrupt handle.
Returns
  • On success, zero.
  • On failure, a negative value.