DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tal Shnaiderman <talshn@nvidia.com>
To: Pallavi Kadam <pallavi.kadam@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	"ranjit.menon@intel.com" <ranjit.menon@intel.com>,
	"dmitry.kozliuk@gmail.com" <dmitry.kozliuk@gmail.com>,
	"Narcisa.Vasile@microsoft.com" <Narcisa.Vasile@microsoft.com>,
	"qiao.liu@intel.com" <qiao.liu@intel.com>,
	Idan Hackmon <idanhac@nvidia.com>
Subject: RE: [PATCH] eal/windows: set pthread affinity
Date: Tue, 1 Feb 2022 06:29:37 +0000	[thread overview]
Message-ID: <BL1PR12MB53806D1E5C2FF304170C0F40A4269@BL1PR12MB5380.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20220121001749.458-1-pallavi.kadam@intel.com>

> Subject: [PATCH] eal/windows: set pthread affinity
> 
> External email: Use caution opening links or attachments
> 
> 
> 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. */
> --
> 2.31.1.windows.1

Acked-by: Tal Shnaiderman <talshn@nvidia.com>


  parent reply	other threads:[~2022-02-01  6:29 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
2022-02-01  6:29 ` Tal Shnaiderman [this message]
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=BL1PR12MB53806D1E5C2FF304170C0F40A4269@BL1PR12MB5380.namprd12.prod.outlook.com \
    --to=talshn@nvidia.com \
    --cc=Narcisa.Vasile@microsoft.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=idanhac@nvidia.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).