From: Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>
To: Pallavi Kadam <pallavi.kadam@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net, ranjit.menon@intel.com,
dmitry.kozliuk@gmail.com, Narcisa.Vasile@microsoft.com,
qiao.liu@intel.com
Subject: Re: [PATCH] eal/windows: set pthread affinity
Date: Tue, 25 Jan 2022 22:45:01 -0800 [thread overview]
Message-ID: <20220126064501.GA7862@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <20220121001749.458-1-pallavi.kadam@intel.com>
On Thu, Jan 20, 2022 at 04:17:49PM -0800, Pallavi Kadam wrote:
> Sometimes OS tries to switch the core. So, bind the lcore thread
> to a fixed core.
> Implement affinity call on Windows similar to Linux.
>
> Signed-off-by: Qiao Liu <qiao.liu@intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> ---
> lib/eal/windows/eal.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
> index 67db7f099a..ca3c41aaa7 100644
> --- a/lib/eal/windows/eal.c
> +++ b/lib/eal/windows/eal.c
> @@ -422,6 +422,10 @@ rte_eal_init(int argc, char **argv)
> /* create a thread for each lcore */
> if (eal_thread_create(&lcore_config[i].thread_id) != 0)
> rte_panic("Cannot create thread\n");
> + ret = pthread_setaffinity_np(lcore_config[i].thread_id,
> + sizeof(rte_cpuset_t), &lcore_config[i].cpuset);
> + if (ret != 0)
> + RTE_LOG(DEBUG, EAL, "Cannot set affinity\n");
> }
>
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
next prev parent reply other threads:[~2022-01-26 6:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 0:17 Pallavi Kadam
2022-01-26 6:45 ` Narcisa Ana Maria Vasile [this message]
2022-01-26 18:41 ` Menon, Ranjit
2022-02-01 6:29 ` Tal Shnaiderman
2022-02-01 7:52 ` Idan Hackmon
2022-02-02 22:45 ` Thomas Monjalon
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=20220126064501.GA7862@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=navasile@linux.microsoft.com \
--cc=Narcisa.Vasile@microsoft.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=pallavi.kadam@intel.com \
--cc=qiao.liu@intel.com \
--cc=ranjit.menon@intel.com \
--cc=thomas@monjalon.net \
/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).