How to rte_epoll_wait for IPC?
Stephen Hemminger
stephen at networkplumber.org
Fri Oct 6 18:03:06 CEST 2023
On Fri, 6 Oct 2023 12:03:46 +0200
Morten Brørup <mb at smartsharesystems.com> wrote:
> 2. The "processing" thread receives its packets from the rte_ring. This thread should sleep until packets are ready for it in the rte_ring.
>
> The "ingress" thread knows when it puts packets into the rte_ring, so it can signal that event to the "processing" thread, to wake it up; either as an interrupt/signal, or through a file descriptor. Is this supported by rte_epoll (or other DPDK APIs), and how?
When having to do this in applications, I used a eventfd() as well as the rte ring.
The ingress write's to eventfd and the other thread used epoll on the fd.
Optimized this by having the ingress thread only signal via write if ring was in empty state.
And the reader thread only needs to do (epoll/read) if ring became empty during last cycle;
i.e num packets from rte_ring_burst() was 0.
Basically, when using epoll and other SW event models, you need to turn all data sources
into file descriptors.
More information about the dev
mailing list