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 A32BF43337; Wed, 15 Nov 2023 12:16:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 226A440285; Wed, 15 Nov 2023 12:16:23 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id C1F3540268 for ; Wed, 15 Nov 2023 12:16:21 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 8E0EF206C3; Wed, 15 Nov 2023 12:16:19 +0100 (CET) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH 02/43] eal: use rte strerror X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Wed, 15 Nov 2023 12:16:18 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F025@smartserver.smartshare.dk> In-Reply-To: <20231114161813.29e9b73c@hermes.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 02/43] eal: use rte strerror Thread-Index: AdoXWT0fCQnT5LT6SBiEd+PxIsMwQAAWwfaw References: <20231114082539.1858594-1-huangdengdui@huawei.com> <20231114082539.1858594-3-huangdengdui@huawei.com> <20231114161813.29e9b73c@hermes.local> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Stephen Hemminger" , "Dengdui Huang" Cc: , , , , 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 > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Wednesday, 15 November 2023 01.18 >=20 > On Tue, 14 Nov 2023 16:24:58 +0800 > Dengdui Huang wrote: >=20 > > The function strerror() is insecure in a multi-thread environment. > > This patch uses rte_strerror() to replace it. > > > > Cc: stable@dpdk.org > > > > Signed-off-by: Dengdui Huang > > Acked-by: Chengwen Feng >=20 > NAK. > rte_strerror() is no more thrad safe than strerror() It is thread safe: https://elixir.bootlin.com/dpdk/v23.11-rc3/source/lib/eal/common/eal_comm= on_errno.c#L31 > and only > is appropriate for rte_errno, ie errors from DPDK. > It is not originally designed as strerror() replacement. I can buy this argument. However, if we ensure that DPDK specific error numbers don't overlap = POSIX (and Windows specific, if any) error numbers, I would consider = rte_strerror() an excellent alternative to strerror(). We could then consider deeming strerror() unsafe, and add it to = checkpatches to recommend rte_strerror() as the general replacement.