DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Menon, Ranjit" <ranjit.menon@intel.com>
To: Pallavi Kadam <pallavi.kadam@intel.com>, <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <dmitry.kozliuk@gmail.com>,
	<Narcisa.Vasile@microsoft.com>, <qiao.liu@intel.com>
Subject: Re: [PATCH] eal/windows: set pthread affinity
Date: Wed, 26 Jan 2022 10:41:24 -0800	[thread overview]
Message-ID: <122ce9c2-f34d-9a0a-3b24-88c06c244dab@intel.com> (raw)
In-Reply-To: <20220121001749.458-1-pallavi.kadam@intel.com>

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

On 1/20/2022 4:17 PM, 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");
>   	}
>   
>   	/* Initialize services so drivers can register services during probe. */

Acked-by: Ranjit Menon <ranjit.menon@intel.com>


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

  parent reply	other threads:[~2022-01-26 18:41 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
2022-01-26 18:41 ` Menon, Ranjit [this message]
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=122ce9c2-f34d-9a0a-3b24-88c06c244dab@intel.com \
    --to=ranjit.menon@intel.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=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).