All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "navasile@linux.microsoft.com" <navasile@linux.microsoft.com>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"dmitry.kozliuk@gmail.com" <dmitry.kozliuk@gmail.com>,
	"dmitrym@microsoft.com" <dmitrym@microsoft.com>,
	"khot@microsoft.com" <khot@microsoft.com>,
	"navasile@microsoft.com" <navasile@microsoft.com>,
	"ocardona@microsoft.com" <ocardona@microsoft.com>,
	"Kadam, Pallavi" <pallavi.kadam@intel.com>,
	"roretzla@microsoft.com" <roretzla@microsoft.com>,
	 "talshn@nvidia.com" <talshn@nvidia.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>
Subject: Re: [PATCH v18 2/8] eal: add thread attributes
Date: Fri, 4 Feb 2022 19:21:10 +0000	[thread overview]
Message-ID: <DM6PR11MB4491AD4C6FFFB6C8540FA87E9A299@DM6PR11MB4491.namprd11.prod.outlook.com> (raw)

> Implement thread attributes for:
> * thread affinity
> * thread priority
> Implement functions for managing thread attributes.
> 
> Priority is represented through an enum that allows for two levels:
> 	- RTE_THREAD_PRIORITY_NORMAL
> 	- RTE_THREAD_PRIORITY_REALTIME_CRITICAL
> 
> Affinity is described by the rte_cpuset_t type.
> 
> An rte_thread_attr_t object can be set to the default values
> by calling rte_thread_attr_init().
> 
> Signed-off-by: Narcisa Vasile <navasile@microsoft.com>
> ---
>  lib/eal/common/rte_thread.c  | 46 ++++++++++++++++++
>  lib/eal/include/rte_thread.h | 91 ++++++++++++++++++++++++++++++++++++
>  lib/eal/version.map          |  4 ++
>  lib/eal/windows/rte_thread.c | 44 +++++++++++++++++
>  4 files changed, 185 insertions(+)
> 
> diff --git a/lib/eal/common/rte_thread.c b/lib/eal/common/rte_thread.c
> index 92a7451b0a..27ad1c7eb0 100644
> --- a/lib/eal/common/rte_thread.c
> +++ b/lib/eal/common/rte_thread.c
> @@ -9,6 +9,7 @@
>  #include <string.h>
> 
>  #include <rte_common.h>
> +#include <rte_debug.h>
>  #include <rte_errno.h>
>  #include <rte_log.h>
>  #include <rte_thread.h>
> @@ -33,6 +34,51 @@ rte_thread_equal(rte_thread_t t1, rte_thread_t t2)
>  	return pthread_equal((pthread_t)t1.opaque_id, (pthread_t)t2.opaque_id);
>  }
> 
> +int
> +rte_thread_attr_init(rte_thread_attr_t *attr)
> +{
> +	RTE_VERIFY(attr != NULL);

As a generic one, here and everywhere:
Please don't use RTE_VERIFY() for checking input function parameters.
We don't want to panic in case of just invalid parameter from user.

> +
> +	CPU_ZERO(&attr->cpuset);
> +	attr->priority = RTE_THREAD_PRIORITY_NORMAL;
> +
> +	return 0;
> +}
> +

             reply	other threads:[~2022-02-04 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 19:21 Ananyev, Konstantin [this message]
2022-02-05  4:41 ` [PATCH v18 2/8] eal: add thread attributes Tyler Retzlaff
2022-02-05  9:00   ` Thomas Monjalon
2022-02-06  3:45     ` Tyler Retzlaff
2022-02-05 12:51   ` Ananyev, Konstantin
  -- strict thread matches above, loose matches on Subject: below --
2021-11-10  3:01 [dpdk-dev] [PATCH v17 00/13] eal: Add EAL API for threading Narcisa Ana Maria Vasile
2021-11-11  1:33 ` [PATCH v18 0/8] " Narcisa Ana Maria Vasile
2021-11-11  1:33   ` [PATCH v18 2/8] eal: add thread attributes Narcisa Ana Maria Vasile

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=DM6PR11MB4491AD4C6FFFB6C8540FA87E9A299@DM6PR11MB4491.namprd11.prod.outlook.com \
    --to=konstantin.ananyev@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=khot@microsoft.com \
    --cc=navasile@linux.microsoft.com \
    --cc=navasile@microsoft.com \
    --cc=ocardona@microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=roretzla@microsoft.com \
    --cc=talshn@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.