From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE6D8A0A0A; Tue, 23 Mar 2021 16:53:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 66200140F40; Tue, 23 Mar 2021 16:53:42 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5FAD64069E for ; Tue, 23 Mar 2021 16:53:40 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 9D86820998F2; Tue, 23 Mar 2021 08:53:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9D86820998F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1616514819; bh=o1GfT9lbxkHEoC53HoBvxYAcJH+Z/RnJSPdHBe/PL04=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KKVQmQCRZ89LVSFChxpd2g7+cAkQM33eM5AKNoTooZ6WbBMibZSzvFcyeVpOixBGn DdbLRvWZ66+qZmikgOcsxgoXjP2ZFcUWfElHnrSuGhqHTsVSTkZ06lOQNlmemhnp42 b86Zl8WlmraF4xVSNticXs3+lS+MGYRm6RjKB0+s= Date: Tue, 23 Mar 2021 08:53:39 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org Message-ID: <20210323155339.GA9666@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1616029240-26588-2-git-send-email-navasile@linux.microsoft.com> <1616458835-28502-1-git-send-email-navasile@linux.microsoft.com> <1616458835-28502-2-git-send-email-navasile@linux.microsoft.com> <20210322195419.291b5584@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210322195419.291b5584@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v2 01/10] eal: add thread id and simple thread functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Mar 22, 2021 at 07:54:19PM -0700, Stephen Hemminger wrote: > On Mon, 22 Mar 2021 17:20:26 -0700 > Narcisa Ana Maria Vasile wrote: > > > @@ -59,7 +92,7 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); > > * > > * @return > > * On success, zero. > > - * On failure, a negative number. > > + * On failure, return a positive errno-style error number. > > */ > > The common pattern in DPDK is to return a negative value for errors. > There is a tradeoff here, should the wrapper functions just mimic what > Posix API's do or not. > > I prefer what this patch does; so users can just assume the rte_thread functions > all work exactly like the pthread versions. yes, there was concern here that suddenly applying sign to errno returned by an rte function that almost looks like a pthread function will lead to a lot of misuse / confusion. if this were to be changed at all i would suggest adopting more consistently the use of rv = -1 and rte_errno set to indicate the error.