DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Cc: dev <dev@dpdk.org>, Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] eal: store control thread CPU affinity in TLS
Date: Fri, 13 Mar 2020 09:34:03 +0100	[thread overview]
Message-ID: <CAJFAV8ypt0VrXkrFn=zOLK6qm-C_yWaEcHEbhmz653r0TGaLHQ@mail.gmail.com> (raw)
In-Reply-To: <20200205102416.698395-1-jerinj@marvell.com>

On Wed, Feb 5, 2020 at 11:24 AM <jerinj@marvell.com> wrote:
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> _cpuset TLS variable stores the CPU affinity of eal thread.
> Populate the _cpuset TLS variable for control thread to
>
> 1) Make rte_thread_get_affinity() and eal_thread_dump_affinity
> functional with control thread.
> 2) Quick access to cpu affinity.
>
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
>  lib/librte_eal/common/eal_common_thread.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/common/eal_common_thread.c
> index 78581753c..99fe1aa4e 100644
> --- a/lib/librte_eal/common/eal_common_thread.c
> +++ b/lib/librte_eal/common/eal_common_thread.c
> @@ -152,10 +152,14 @@ struct rte_thread_ctrl_params {
>  static void *rte_thread_init(void *arg)
>  {
>         int ret;
> +       rte_cpuset_t *cpuset = &internal_config.ctrl_cpuset;
>         struct rte_thread_ctrl_params *params = arg;
>         void *(*start_routine)(void *) = params->start_routine;
>         void *routine_arg = params->arg;
>
> +       /* Store cpuset in TLS for quick access */
> +       memmove(&RTE_PER_LCORE(_cpuset), cpuset, sizeof(rte_cpuset_t));
> +
>         ret = pthread_barrier_wait(&params->configured);
>         if (ret == PTHREAD_BARRIER_SERIAL_THREAD) {
>                 pthread_barrier_destroy(&params->configured);

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


  reply	other threads:[~2020-03-13  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 10:24 jerinj
2020-03-13  8:34 ` David Marchand [this message]
2020-03-25 12:53   ` 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='CAJFAV8ypt0VrXkrFn=zOLK6qm-C_yWaEcHEbhmz653r0TGaLHQ@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=olivier.matz@6wind.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 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).