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 4B098A0C4B; Tue, 9 Nov 2021 09:21:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 104684068B; Tue, 9 Nov 2021 09:21:29 +0100 (CET) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by mails.dpdk.org (Postfix) with ESMTP id 9C0E240687 for ; Tue, 9 Nov 2021 09:21:27 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id DE985580987; Tue, 9 Nov 2021 03:21:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 09 Nov 2021 03:21:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= v0Hq4/48O1thG0IIVxLJKgxKEa5nTWwOtSErzHJTEEA=; b=RUtIEVerBcfamkiN irf6xUFadrLoKArfOHGSY7zEQ6lnVzn6jmK/msLa8JFXCmRoTl5ThfjSLmrFjV0E oby7+pQ39gsGJB5gCiTLFfIvGNix9NZwdXM1f9pozj4QF+Z3+If6stenvxTAdiEd 0AsTYw5+SFbxdjiJf5k+GqY/HT6NROXtjIM0Rmf4Rqg3qbDOl9oi6PT6R54qgcq4 MWM3RZfRwo+GkhVScUrjUDZpjlkPk4AOqcf2fQtft10RUb1m5UXDfDfDLsZzIAIL sEwtAsFJI4rIJZ5WO4N9Ql7bdH9DebakZsaWEpUXlOB7KVNH/8aj2Q3omqzNmKrR QL4umw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=v0Hq4/48O1thG0IIVxLJKgxKEa5nTWwOtSErzHJTE EA=; b=fYgv8Ac3VnV0iQCW3zNOQ9gi7XFsJiJqQuDkH8layLpi74omK2JXDp3Bd vTOELjoYlKgQUSPPLYPmw0c/bbFJkK7jzYudTXAP1uaamh1w3LINvVE+W+sdTkTh 6oieIgoB16zC76qHV5zZZLmax4sWX7ST7wOG9FjhSPHCgXdkiRC0yK58OvrNOFS5 C14jozHKcshbCNriN6Iz8g+u4IBGa+15kqIIzxvt5+cxTnFDP2e59eVp8s3ZvhBg FlvffdmADmtzmxCdHVQjyNanNg0VhSpuyquGagzgsnluFV2jloEWNdjykaPu84lA 08kCvHTmDlYQjtVtU1mDCDivMlbhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Nov 2021 03:21:23 -0500 (EST) From: Thomas Monjalon To: Narcisa Ana Maria Vasile Cc: dev@dpdk.org, dmitry.kozliuk@gmail.com, khot@microsoft.com, navasile@microsoft.com, dmitrym@microsoft.com, roretzla@microsoft.com, talshn@nvidia.com, ocardona@microsoft.com, bruce.richardson@intel.com, david.marchand@redhat.com, pallavi.kadam@intel.com Date: Tue, 09 Nov 2021 09:21:22 +0100 Message-ID: <2274844.FXRrhN1ehX@thomas> In-Reply-To: <20211109020243.GC12569@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1633732841-17873-1-git-send-email-navasile@linux.microsoft.com> <2707621.neF2WRQu8d@thomas> <20211109020243.GC12569@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v16 3/9] eal/windows: translate Windows errors to errno-style errors 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" 09/11/2021 03:02, Narcisa Ana Maria Vasile: > On Tue, Oct 12, 2021 at 06:16:19PM +0200, Thomas Monjalon wrote: > > 09/10/2021 09:41, Narcisa Ana Maria Vasile: > > > From: Narcisa Vasile > > > rte_thread_key_create(rte_thread_key *key, > > > __rte_unused void (*destructor)(void *)) > > > { > > > + int ret; > > > + > > > *key = malloc(sizeof(**key)); > > > if ((*key) == NULL) { > > > RTE_LOG(DEBUG, EAL, "Cannot allocate TLS key.\n"); > > > - rte_errno = ENOMEM; > > > - return -1; > > > + return ENOMEM; > > > } > > > > Why this change? rte_errno and negative error code are good. > > > > This error could have been handled using rte_errno and negative return, > but for consistency, a positive error number is returned. As different platforms > have different error codes, the approach here is to translate the Windows error > to POSIX-style ones to have uniformity over the values returned. All functions > in this thread module return the possible error through the return value. We can have the same consistency with rte_errno. What others think? Should we use rte_errno?