DPDK usage discussions
 help / color / mirror / Atom feed
From: Jamie Fargen <jfargen@redhat.com>
To: 이재홍 <ljh890322@gmail.com>
Cc: users@dpdk.org
Subject: Re: quick question about core affinity
Date: Wed, 26 Apr 2023 08:31:01 -0400	[thread overview]
Message-ID: <CAB-EjEJgOtotaiOhjx-k=fFcEUZWuJeNO0c-orYPbHLM+PqN7w@mail.gmail.com> (raw)
In-Reply-To: <CA+WmBsRvUz7vgnDUyUVSC_7AG+O1PNzBmcnFQfb56FG9X9Djpg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2525 bytes --]

Depending on the OS there maybe other ways to accomplish core isolation,
but it is documented in this page, section 7.1.3
<https://doc.dpdk.org/guides-16.04/linux_gsg/nic_perf_intel_platform.html#linux-boot-command-line>
[1].
You need to add the cores to the linux command line,

In the example you have given will need to add isolcpus=0-2 to the
linux command line.


You will likely want to inspect system cores and make sure they are on the
same numa node by ensuring that those cores are on the same 'physical core'
and you can do that by examining /proc/cpuinfo and verifying the cores have
the same 'physical id'.

You can see on this system, core 0 is on numa 0 and core 1, is on numa 1,
this would not be an optimal configuration, and instead it would be better
to use 2,4,6 or 3,5,7. You maybe asking why cores 0,1 were omitted, and
that is because some clock and timing functions of the kernel run on the
first core of the physical cpu.

$ cat /proc/cpuinfo  | grep 'processor\|physical'
processor : 0
physical id : 0
address sizes : 46 bits physical, 57 bits virtual
processor : 1
physical id : 1
address sizes : 46 bits physical, 57 bits virtual
processor : 2
physical id : 0
address sizes : 46 bits physical, 57 bits virtual
processor : 3
physical id : 1

Aother tip is you will want the cores to be on the same path as the
datapath nic. You can determine which numa node the network device is
attached to by inspecting the following file for the nic you are using for
the datapath.

# cat /sys/class/net/eno12399/device/numa_node
0



Reference Link(s):
1 -
https://doc.dpdk.org/guides-16.04/linux_gsg/nic_perf_intel_platform.html#linux-boot-command-line

On Wed, Apr 26, 2023 at 7:38 AM 이재홍 <ljh890322@gmail.com> wrote:

> Hello, I'm new to DPDK
>
> I've tried to run samples and got a query about core affinity.
> As I understand, if a lcore has affinity to a CPU set, it will run only on
> the CPU set.
> And I thought If I run a dpdk sample with core 0-2, none process can use
> the core (0-2). but when I try to run a simple app(not dpdk app) with
> taskset command, it runs on 0, 1, 2 cores..
>
> what I want was if I use cores for dpdk apps none other process can access
> the cores.. but it seems possible..
>
> I've googled to find out this but I couldn't find anything I wanted.
> Is there anyone can explain about this...?
>
>
> BR.
> Jaehong Lee
>


-- 
Jamie Fargen
Senior Engineer
jfargen@redhat.com
813-580-0718

[-- Attachment #2: Type: text/html, Size: 4211 bytes --]

      parent reply	other threads:[~2023-04-26 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 11:37 이재홍
2023-04-26 12:20 ` Lukáš Šišmiš
2023-04-26 12:26   ` 이재홍
2023-04-26 16:27   ` Stephen Hemminger
2023-04-26 12:31 ` Jamie Fargen [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='CAB-EjEJgOtotaiOhjx-k=fFcEUZWuJeNO0c-orYPbHLM+PqN7w@mail.gmail.com' \
    --to=jfargen@redhat.com \
    --cc=ljh890322@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).