All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev <dev@dpdk.org>, Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Subject: Re: [PATCH] eal/windows: set Windows main lcore affinitization
Date: Thu, 7 Apr 2022 15:14:33 +0200	[thread overview]
Message-ID: <CAJFAV8w+9Nxf_T_G2xGdTMFD=Mi1-F7k-VBAGJt-a=BqrfkA0A@mail.gmail.com> (raw)
In-Reply-To: <1648630829-4372-1-git-send-email-roretzla@linux.microsoft.com>

Hello Tyler,

On Wed, Mar 30, 2022 at 11:00 AM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> add missing code to affinitize main_lcore from lcore configuration.

Nit: Add*

>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
>  lib/eal/windows/eal.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
> index ca3c41a..9c61780 100644
> --- a/lib/eal/windows/eal.c
> +++ b/lib/eal/windows/eal.c
> @@ -401,6 +401,12 @@ enum rte_proc_type_t
>                 return -1;
>         }
>
> +       if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
> +                       &lcore_config[config->main_lcore].cpuset) != 0) {
> +               rte_eal_init_alert("Cannot set affinity");
> +               rte_errno = EINVAL;
> +               return -1;
> +       }
>         __rte_thread_init(config->main_lcore,
>                 &lcore_config[config->main_lcore].cpuset);
>

- It looks like the affinity is dumped for workers (see below), I
would dump affinity for the main lcore like other OS do:

    ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));

    RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
        config->main_lcore, thread_id, cpuset,
        ret == 0 ? "" : "...");


- Which makes me notice that windows/eal_thread.c probably dumps
random stuff in logs because it is missing a call to
eal_thread_dump_current_affinity() to format affinity as a string.

lib/eal/windows/eal_thread.c:   char cpuset[RTE_CPU_AFFINITY_STR_LEN];
lib/eal/windows/eal_thread.c:   __rte_thread_init(lcore_id,
&lcore_config[lcore_id].cpuset);
lib/eal/windows/eal_thread.c:   RTE_LOG(DEBUG, EAL, "lcore %u is ready
(tid=%zx;cpuset=[%s])\n",
lib/eal/windows/eal_thread.c:           lcore_id, (uintptr_t)thread_id, cpuset);


-- 
David Marchand


  reply	other threads:[~2022-04-07 13:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30  9:00 [PATCH] eal/windows: set Windows main lcore affinitization Tyler Retzlaff
2022-04-07 13:14 ` David Marchand [this message]
2022-04-12 16:30   ` Tyler Retzlaff
2022-04-14  9:50     ` David Marchand
2022-04-14 12:40 ` [PATCH v2] " Tyler Retzlaff
2022-04-14 12:43 ` [PATCH v3] " Tyler Retzlaff
2022-04-14 13:08   ` David Marchand
2022-04-25  8:28     ` David Marchand

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='CAJFAV8w+9Nxf_T_G2xGdTMFD=Mi1-F7k-VBAGJt-a=BqrfkA0A@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=roretzla@linux.microsoft.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.