DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: "Harman Kalra" <hkalra@marvell.com>,
	"Anatoly Burakov" <anatoly.burakov@intel.com>,
	"David Hunt" <david.hunt@intel.com>, <dev@dpdk.org>
Subject: Re: How to rte_epoll_wait for IPC?
Date: Fri, 6 Oct 2023 09:03:06 -0700	[thread overview]
Message-ID: <20231006090306.0ba9d5e6@hermes.local> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9EF02@smartserver.smartshare.dk>

On Fri, 6 Oct 2023 12:03:46 +0200
Morten Brørup <mb@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. 

  parent reply	other threads:[~2023-10-06 16:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 10:03 Morten Brørup
2023-10-06 15:27 ` Honnappa Nagarahalli
2023-10-06 15:53   ` Morten Brørup
2023-10-30 13:07     ` Honnappa Nagarahalli
2023-10-06 16:03 ` Stephen Hemminger [this message]
2023-10-06 16:28   ` Morten Brørup
2023-10-06 17:04     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231006090306.0ba9d5e6@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=hkalra@marvell.com \
    --cc=mb@smartsharesystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).