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 8E812A04FF; Tue, 12 Apr 2022 19:29:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CE4740DF6; Tue, 12 Apr 2022 19:29:18 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 99C084014F for ; Tue, 12 Apr 2022 19:29:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649784557; x=1681320557; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=+s+OecxCB0kgEmAjUIgfpdEhouzgYl1tP29sfpEdWW0=; b=gXzPdACg3M8D9eSzrktV/azW+0f54mFWG3RDF9EM/L2to19CbCJ0m4Nm 4ceAO90cCkLkqp4gTPAJMmQ7sQQXxZhzTzAfSxbx/muYx7fDSvuuk/MXF kEjaLxcNoA1q/k8fxzLU4XHMYjGBaE4qE3A6n8bKSSh0mXyObFfQMtiWt 8XHhlNeXL8niWZuZnSaRMdB9jhoTZXIqO5nBVCrOzkHFembKtMlAyaHkt Os27DvLJIxO6wlUn1jdsr6xoLl2AltZy1QhwS9P8Atab1Td8D0bkBAa2z mJWhFLggDVa8/Ut3L7WNXy8QY/ywyk4HqKGEb1A0hNi2QOQg0CrzqUF77 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="261297753" X-IronPort-AV: E=Sophos;i="5.90,254,1643702400"; d="scan'208";a="261297753" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 10:26:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,254,1643702400"; d="scan'208";a="551822306" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga007.jf.intel.com with ESMTP; 12 Apr 2022 10:26:35 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 12 Apr 2022 10:26:32 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 12 Apr 2022 10:26:32 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 12 Apr 2022 10:26:32 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.170) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 12 Apr 2022 10:26:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=axduhksLugriHC7Vje+iBXXWL7/QqkhsDosDegYTfe+a0xzOUJYvWZ/p9SmJEcOP5Ily5tmgSZWHvDBvJSmoYlg4jBa47Ee7xcPEijavkp1V6+3UACfuTyxpluWo9+KvJjf3mccRrkLrGNdQ7UB6bOqmND+1dVdFQMayGB0XS3I/z0I7HauQ65B3p+37OZxVjJ5zJdLPxFdNPNOKqyhmB9n8vcwFIxAr4Z7JfQLRhORzeYu9ZQKBbaZ4G3kEzpbonD5puzuYCuEp86JgGxVWe9TWGc88usi2ORcwW5bFKtx0qN7DZ9Iao06HCWtP3gUpnf9tR8v58WZqQ5O/FWkVxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UWmMuMjGmTrlFKYN/SBMFS/NRG/tnaDtESTJyUcQL8g=; b=CVPWnuAJXa30xs1am/uMMRnJIYhDq9jp1BrJM50//Mi2lsTuY8T/S6pBzWwaL4NZn0FoJ4s/kscEzdq8dBsX8z8XzqVqv6d01nxeGe669cRqX+cZQBStZJjXWGemwOXh/hY3A7zt1O6DAgYIxb5D8MEYxy+Ig01Nzrsz+F59NyMXJpevSr+9As/naJwH/fBOWVIeo/L3AOuaCE2AYgq/usX5Zk+4ruRfByNBDidGPBMZbV6VrtnFpuZus7IjGwShWU82u8OVKauPK8u5GF0ZS5PImXZBL0pdrt71xxRk21oCetEFvMOoQ6BYG6wLmXri337iLfwWsOX2emDtIi2W7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BL1PR11MB6025.namprd11.prod.outlook.com (2603:10b6:208:390::16) by DM6PR11MB4740.namprd11.prod.outlook.com (2603:10b6:5:2ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Tue, 12 Apr 2022 17:26:31 +0000 Received: from BL1PR11MB6025.namprd11.prod.outlook.com ([fe80::b46d:c855:1af2:34d6]) by BL1PR11MB6025.namprd11.prod.outlook.com ([fe80::b46d:c855:1af2:34d6%3]) with mapi id 15.20.5144.028; Tue, 12 Apr 2022 17:26:30 +0000 Message-ID: <55647598-0f70-bcd4-b381-54927e160561@intel.com> Date: Tue, 12 Apr 2022 10:26:27 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 1/4] eal/windows: translate Windows errors to errno-style errors Content-Language: en-US To: Tyler Retzlaff , CC: , , , Narcisa Vasile References: <1648819793-18948-1-git-send-email-roretzla@linux.microsoft.com> <1649760220-8683-1-git-send-email-roretzla@linux.microsoft.com> <1649760220-8683-2-git-send-email-roretzla@linux.microsoft.com> From: "Menon, Ranjit" In-Reply-To: <1649760220-8683-2-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR05CA0057.namprd05.prod.outlook.com (2603:10b6:a03:74::34) To BL1PR11MB6025.namprd11.prod.outlook.com (2603:10b6:208:390::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42a474be-fb8c-43a9-79af-08da1ca99528 X-MS-TrafficTypeDiagnostic: DM6PR11MB4740:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jFkPEGYftyvzj9SlugGx1Vdeizxx2PxHZI8kvje+xCTPSTzW1o1O/LjMqNjTj7QFbiy7mLb+OMEx4jgNJGBF/YZbiGcL3B+LyFMKKoHcWvU4E7ubFNW7tbYWosaMtmUNFrPObx/5HBtEXDDAPIsnGPJMevCMPsB261eKkcF6N9a/HR7/BspR5i5zfxFBE7g+q446bHqlSaCNZZtESPpk8LzsC/PFqZEqhxkdEflo82hg3USqCdRbdWojcLmttgm7qTUVvfvk5vvrffQ0XV2kx2zqARGApiZw0clX8eULybGvLcwnTw5PRQfiOzsgpnkjLdWRt9PZ0izF06JwWAWHSMuiZCZvPL9Z0PLUG8UkQn3/PRFGBbfF0ZclTDdAl7fcX5vOBrVOPag579DV792JPoYXl6QC8aM6K/sGfZ+MVLoPtsOdn3FJM7ocsko7kXvTMkz5UHVFMKQbLZILFP9vhNaUKAX9lH/046EeLkanuZ8cp+lVZfoSnyRcXKs5h5DFzQEZ5KRaz9v/eIATsMvBibkY2jfr6P7KkG+nlQRTaEbjYefMZ00DLukZdt6AQjgK8snqhFa4qM+KY3kMu6hCkgB2Oa68SkmIzndr0MmozyKPJQKKCoDr4jyLeeJRp0uuDdp+p9BrOECwQjoyy5QkPX281bOYVEbcJPvON7Jr8pdn6/15n276INCnhn04rmghQt5DJ5SrMy5N6OGyYA/8cZwQQAycOW0pRYf2OjTvadE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL1PR11MB6025.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(6506007)(6666004)(4326008)(82960400001)(53546011)(6486002)(36756003)(31686004)(5660300002)(2906002)(6512007)(83380400001)(186003)(31696002)(26005)(316002)(45080400002)(2616005)(38100700002)(86362001)(66946007)(508600001)(8676002)(66476007)(66556008)(8936002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NXI1SHcxT1h4MkV5MHE1dkxaTGdGR1ZQQmdCQkd3dkxUOU1xUm1ya1RXYjFK?= =?utf-8?B?d2ZpaExrQzNLSC9CcGw1NWpVRHJhK3JTNDhxbENWVVllZnFwOHhDZDVrbk5h?= =?utf-8?B?UnVnMWVRMlRFY2o0dzhPME5OK1k2ZlNwdEwwU1dmcXZRbTJZQWNsSkRGMjMy?= =?utf-8?B?RDNWQlkxQ1ltME4xdklpRlV6dExuUGNSUlJ3Qnd0Lyt0a1ZSK3MxejFNWmRG?= =?utf-8?B?aFV4MUZpalVyY1BEY1NyelFGR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ktZVTRrUFJma0NDMU1mMVJRK202eXhzOXc5V0RGSWpMYU1uREZEMjJhRncz?= =?utf-8?B?SmJmcjY3eGtLYUtySEsxc1FucHlVTXVQU1BnMlhsQzB5QVY2UWg3NkFJNTRa?= =?utf-8?B?b2wwRU9uREpFelArNnE0R3BPZzdNeVVXM2xvanVHMGcvZnNKTGpxODBUbEVI?= =?utf-8?B?Tjl3S05remd1aGZZNEtLVlFwdXNYdjU1ZUVjRk11MTcxRWppWldLS3JnUTJv?= =?utf-8?B?akkrWm1FM0Q4bEtoUnRWcVFheC91cnJtbzUyQStPalJRTFdkYkhYSklrenZq?= =?utf-8?Q?YW0W4pa5sh3dY1Lo=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 42a474be-fb8c-43a9-79af-08da1ca99528 X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB6025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2022 17:26:30.6042 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sggihLi2Wv3QIPnfiHdppFHLWqWFUl925KD8jIRZdLvqdg6z2W1YOAikxpGPAz7ya7EkrXKDhDPqWAWrqJPFUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4740 X-OriginatorOrg: intel.com 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 Hi, Tyler On 4/12/2022 3:43 AM, Tyler Retzlaff wrote: > Add function to translate Windows error codes to errno-style error > codes. The possible return values are chosen so that we have as > much semantical compatibility between platforms as possible. > > Signed-off-by: Narcisa Vasile > Signed-off-by: Tyler Retzlaff > --- > lib/eal/windows/rte_thread.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > > diff --git a/lib/eal/windows/rte_thread.c b/lib/eal/windows/rte_thread.c > index 667287c..c272018 100644 > --- a/lib/eal/windows/rte_thread.c > +++ b/lib/eal/windows/rte_thread.c > @@ -1,5 +1,6 @@ > /* SPDX-License-Identifier: BSD-3-Clause > * Copyright 2021 Mellanox Technologies, Ltd > + * Copyright (C) 2022 Microsoft Corporation > */ > > #include > @@ -11,6 +12,54 @@ struct eal_tls_key { > DWORD thread_index; > }; > > +/* Translates the most common error codes related to threads */ > +static int > +thread_translate_win32_error(DWORD error) > +{ > + switch (error) { > + case ERROR_SUCCESS: > + return 0; > + > + case ERROR_INVALID_PARAMETER: > + return EINVAL; > + > + case ERROR_INVALID_HANDLE: > + return EFAULT; > + > + case ERROR_NOT_ENOUGH_MEMORY: > + /* FALLTHROUGH */ > + case ERROR_NO_SYSTEM_RESOURCES: > + return ENOMEM; > + > + case ERROR_PRIVILEGE_NOT_HELD: > + /* FALLTHROUGH */ > + case ERROR_ACCESS_DENIED: > + return EACCES; > + > + case ERROR_ALREADY_EXISTS: > + return EEXIST; > + > + case ERROR_POSSIBLE_DEADLOCK: > + return EDEADLK; > + > + case ERROR_INVALID_FUNCTION: > + /* FALLTHROUGH */ > + case ERROR_CALL_NOT_IMPLEMENTED: > + return ENOSYS; > + } > + > + return EINVAL; > +} > + Shouldn't we return all these error values as negative... as in -EINVAL, -EFAULT etc. ? ranjit m.