From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6AF4C433E0 for ; Tue, 23 Mar 2021 15:53:43 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 5F891619C0 for ; Tue, 23 Mar 2021 15:53:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F891619C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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.