All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: "navasile@linux.microsoft.com" <navasile@linux.microsoft.com>,
	"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: Sat, 5 Feb 2022 12:51:53 +0000	[thread overview]
Message-ID: <DM6PR11MB4491C74350C1EB0E528FFAF09A2A9@DM6PR11MB4491.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220205044140.GA7734@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>


> 
> On Fri, Feb 04, 2022 at 07:21:10PM +0000, Ananyev, Konstantin wrote:
> > > 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.
> 
> i ask this question again. what useful thing will the user application
> do when handling -EINVAL or rte_errno = EINVAL is returned for
> incorrectly supplied parameters?

Let the user application to decide.
But inside the lib we shouldn't just crash if user provided invalid parameters
for one of our functions.

> 
> again, there should be a mechanism that allows a policy for how these
> non-recoverable errors are handled rather than defaulting to tossing
> it over the fence and expecting the application to do something
> sensible when the only thing it could do is conclusively more
> complicated than having passed the correct parameters in the first place.
> 
> more often then not application programmers will ignore superfluous
> return values from functions like this resulting in the bug remaining
> longer and the state / reason being lost.
> 
> please reconsider.

  parent reply	other threads:[~2022-02-05 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 19:21 [PATCH v18 2/8] eal: add thread attributes Ananyev, Konstantin
2022-02-05  4:41 ` Tyler Retzlaff
2022-02-05  9:00   ` Thomas Monjalon
2022-02-06  3:45     ` Tyler Retzlaff
2022-02-05 12:51   ` Ananyev, Konstantin [this message]
  -- 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=DM6PR11MB4491C74350C1EB0E528FFAF09A2A9@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@linux.microsoft.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.