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 38C85A0561; Wed, 3 Mar 2021 12:10:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A590D40683; Wed, 3 Mar 2021 12:10:20 +0100 (CET) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mails.dpdk.org (Postfix) with ESMTP id 204164067B for ; Wed, 3 Mar 2021 12:10:19 +0100 (CET) Received: by mail-lf1-f43.google.com with SMTP id p21so36408361lfu.11 for ; Wed, 03 Mar 2021 03:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ys/cqaHF5xuX1y9RuM63NYFTOLAcog+XHCFU3+7OVCk=; b=j5aaKgGjVwfNsrzHNQGY+GD8gbVHEap0azaasK2dqCZ5dsN8DD5DHn0LOlX3hC/fAN QY/EeYf8gyV2lyVJixucrFOT1DwwbVm8mMvKyRGjZ+leX4eQJ1JFQNTODgTPnhtZWGuH Ovu137E7px1qpzefJlljWmHuIVzvnFmqkrTV7EZGE+viAEOndUjePlFSlNHiAJOTsuf9 WBQ+LWQSbzDum+kXgfiwqXZEIePrdlc1+6zhtS6PhcvQny6wAkT7TeIOK82GImNsdm0x kttMCn+dyrQjIcyd+AzBicsxZjlAVZC2q18cSTg3UiMypRO3zmtvEgbbL0kkqSAZW/me yCqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ys/cqaHF5xuX1y9RuM63NYFTOLAcog+XHCFU3+7OVCk=; b=gwZgEVN6jSW+FaWphqrofYDcR0L+FAON7h7KNEqvSTMqoP+kKC5M5TfpwjnKcfgh0K gwfoexg5BB1TeYaNHO1/liBhYrXTw9UBLoueAJ8oiq1aZK9+VneP0q3kiPSnA/uMP+uv JeVNH7RTqJPNIitJ7JN7bCCdKcE3MKMPwahz21Y9a+SBZwtD5+EGCBylITOn0+eQs1G5 R6VTBssDJzt5p9Zy9hG7hv6cCdVzUT/dGoMS5ou4kY1zIqXsXqBYOGpwiMsmHaC4NFbk xC5KqogdZrvLsran6JpKuzam4E/0OXF2BXF2311OVyzoQOGsxuO4SXJPtmZYOACyHVeK CfVw== X-Gm-Message-State: AOAM531XLbf7b0pZRf/KFvq/uG/88fu2H+Wf+l5sy98DwXIdyKu1sHAV 9GzTpu3980qU3cgNPiLKLOs= X-Google-Smtp-Source: ABdhPJzaX1SjCeRvJBUqCb88sYDruLa4SdlgQyJYun6TJ9yJMEj56+ADFC6PKQy8luMDwZ870kp0xQ== X-Received: by 2002:ac2:47ea:: with SMTP id b10mr10025163lfp.499.1614769818612; Wed, 03 Mar 2021 03:10:18 -0800 (PST) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id i5sm1383698ljn.100.2021.03.03.03.10.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 03:10:18 -0800 (PST) Date: Wed, 3 Mar 2021 14:10:16 +0300 From: Dmitry Kozlyuk To: Tal Shnaiderman Cc: "dev@dpdk.org" , NBU-Contact-Thomas Monjalon , "pallavi.kadam@intel.com" , "navasile@linux.microsoft.com" , "dmitrym@microsoft.com" , "david.marchand@redhat.com" , "anatoly.burakov@intel.com" , "vladimir.medvedkin@intel.com" , "mb@smartsharesystems.com" Message-ID: <20210303141016.5e9071dd@sovereign> In-Reply-To: References: <20210302152658.9136-1-talshn@nvidia.com> <20210302152658.9136-2-talshn@nvidia.com> <20210302200912.63b57033@sovereign> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 1/2] eal: error number enhancement for thread TLS API 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" 2021-03-03 10:37, Tal Shnaiderman: > > Subject: Re: [PATCH v2 1/2] eal: error number enhancement for thread TLS > > API > > > > External email: Use caution opening links or attachments > > > > > > 2021-03-02 17:26, Tal Shnaiderman: > > > add error number reporting to rte_errno in all functions in the > > > rte_thread_tls_* API. > > > > > > Suggested-by: Anatoly Burakov > > > Signed-off-by: Tal Shnaiderman > > > --- > > > lib/librte_eal/include/rte_thread.h | 6 +++--- > > > lib/librte_eal/unix/rte_thread.c | 6 ++++++ > > > lib/librte_eal/windows/rte_thread.c | 8 +++++++- > > > 3 files changed, 16 insertions(+), 4 deletions(-) > > > > Using OS error codes for rte_errno isn't the right thing to do: this way callers > > cannot write a portable check of rte_thread_*() result. Consider returning > > some suitable stable values. OS-specific error info can be logged at debug > > level, as it is already is some places. > > In Linux the error codes return are not OS specific (namely EAGAIN, ENOMEM and EINVAL). > > The problem is that documentation on Windows doesn't publish which error code can be returned from GetLastError() for the TLS functions. > > Or do we want to use the same errno for both OSs in case the functions fail regardless to the failure reason? Yes, so that callers know which codes to check against regardless of the OS.