DPDK  24.07.0
Data Structures | Macros | Functions
rte_epoll.h File Reference
#include <stdint.h>
#include <rte_stdatomic.h>

Go to the source code of this file.

Data Structures

struct  rte_epoll_event
 

Macros

#define RTE_EPOLL_PER_THREAD   -1
 

Functions

int rte_epoll_wait (int epfd, struct rte_epoll_event *events, int maxevents, int timeout)
 
int rte_epoll_wait_interruptible (int epfd, struct rte_epoll_event *events, int maxevents, int timeout)
 
int rte_epoll_ctl (int epfd, int op, int fd, struct rte_epoll_event *event)
 

Detailed Description

The rte_epoll provides interfaces functions to add delete events, wait poll for an event.

Definition in file rte_epoll.h.

Macro Definition Documentation

◆ RTE_EPOLL_PER_THREAD

#define RTE_EPOLL_PER_THREAD   -1

to hint using per thread epfd

Examples:
examples/l3fwd-power/main.c.

Definition at line 48 of file rte_epoll.h.

Function Documentation

◆ rte_epoll_wait()

int rte_epoll_wait ( int  epfd,
struct rte_epoll_event events,
int  maxevents,
int  timeout 
)

It waits for events on the epoll instance. Retries if signal received.

Parameters
epfdEpoll instance fd on which the caller wait for events.
eventsMemory area contains the events that will be available for the caller.
maxeventsUp to maxevents are returned, must greater than zero.
timeoutSpecifying a timeout of -1 causes a block indefinitely. Specifying a timeout equal to zero cause to return immediately.
Returns
  • On success, returns the number of available event.
  • On failure, a negative value.
Examples:
examples/l3fwd-power/main.c.

◆ rte_epoll_wait_interruptible()

int rte_epoll_wait_interruptible ( int  epfd,
struct rte_epoll_event events,
int  maxevents,
int  timeout 
)

It waits for events on the epoll instance. Does not retry if signal received.

Parameters
epfdEpoll instance fd on which the caller wait for events.
eventsMemory area contains the events that will be available for the caller.
maxeventsUp to maxevents are returned, must greater than zero.
timeoutSpecifying a timeout of -1 causes a block indefinitely. Specifying a timeout equal to zero cause to return immediately.
Returns
  • On success, returns the number of available event.
  • On failure, a negative value.

◆ rte_epoll_ctl()

int rte_epoll_ctl ( int  epfd,
int  op,
int  fd,
struct rte_epoll_event event 
)

It performs control operations on epoll instance referred by the epfd. It requests that the operation op be performed for the target fd.

Parameters
epfdEpoll instance fd on which the caller perform control operations.
opThe operation be performed for the target fd.
fdThe target fd on which the control ops perform.
eventDescribes the object linked to the fd. Note: The caller must take care the object deletion after CTL_DEL.
Returns
  • On success, zero.
  • On failure, a negative value.