DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] eal: store control thread CPU affinity in TLS
@ 2020-02-05 10:24 jerinj
  2020-03-13  8:34 ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: jerinj @ 2020-02-05 10:24 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, david.marchand, Jerin Jacob

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);
-- 
2.24.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: store control thread CPU affinity in TLS
  2020-02-05 10:24 [dpdk-dev] [PATCH] eal: store control thread CPU affinity in TLS jerinj
@ 2020-03-13  8:34 ` David Marchand
  2020-03-25 12:53   ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2020-03-13  8:34 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Olivier Matz

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: store control thread CPU affinity in TLS
  2020-03-13  8:34 ` David Marchand
@ 2020-03-25 12:53   ` David Marchand
  0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2020-03-25 12:53 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Olivier Matz

On Fri, Mar 13, 2020 at 9:34 AM David Marchand
<david.marchand@redhat.com> wrote:
> 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>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.

-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-25 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 10:24 [dpdk-dev] [PATCH] eal: store control thread CPU affinity in TLS jerinj
2020-03-13  8:34 ` David Marchand
2020-03-25 12:53   ` David Marchand

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).