DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Daniel May <danielmay83@gmail.com>
Cc: users@dpdk.org
Subject: Re: All non-dpdk application threads assigned to the same core after calling rte_eal_init()
Date: Mon, 11 Aug 2025 08:13:54 -0700	[thread overview]
Message-ID: <20250811081332.4d25980c@hermes.local> (raw)
In-Reply-To: <CAKazox2uwKKNYqCTOfGd5qjBy1ATx5_4H=Uza=aUS6U=dvRx5w@mail.gmail.com>

On Mon, 28 Jul 2025 09:57:28 -0500
Daniel May <danielmay83@gmail.com> wrote:

> Hello,
> 
> I have a C++ application which uses DPDK to receive packets over two 100
> Gbps interfaces from an FPGA device.
> 
> I've isolated cores 0-2. DPDK is using cores 0-2, main lcore on 0, and two
> receive threads on cores 1 and 2.  The receive threads read packets from
> mbufs and move the packets to a couple of circular buffers.  This works as
> expected.
> 
> The application starts another set of threads (worker threads) to read from
> the circular buffers and handle the data. However, these threads are all
> being assigned to core 0, instead of cores 3-n.

If you are creating the threads from another thread, the new thread inherits
the affinity mask of the parent. In you example, it looks like you are spawning
the threads from the main lcore (0).

> If I start the worker threads first, before calling rte_eal_init(), they
> get assigned to non isolated cores as expected.  However, any thread I
> start from the main thread after calling rte_eal_init() gets assigned to
> the main lcore core (0).  I can set affinity manually, but I'd rather the
> kernel scheduler do its thing.
> 
> Is there something I need to do to hand control back to the kernel
> scheduler for assigning threads to cores after initializing DPDK?

The way to fix is to call set affinity to tell kernel what you want.


      reply	other threads:[~2025-08-11 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-28 14:57 Daniel May
2025-08-11 15:13 ` Stephen Hemminger [this message]

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=20250811081332.4d25980c@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=danielmay83@gmail.com \
    --cc=users@dpdk.org \
    /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).