From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id DC87D4333A;
	Wed, 15 Nov 2023 16:06:42 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id A5615402B0;
	Wed, 15 Nov 2023 16:06:42 +0100 (CET)
Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com
 [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 3B95A4027D
 for <dev@dpdk.org>; Wed, 15 Nov 2023 16:06:41 +0100 (CET)
Received: by mail-pj1-f41.google.com with SMTP id
 98e67ed59e1d1-28028f92709so448463a91.0
 for <dev@dpdk.org>; Wed, 15 Nov 2023 07:06:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1700060800;
 x=1700665600; darn=dpdk.org; 
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:from:to:cc:subject:date
 :message-id:reply-to;
 bh=wepq5yXq6ZDxa/f/BwIKVrMs3UB2LDVcpVMo6pPamL0=;
 b=wP11HnqyJq4dMGSCaEDardEVKcFKu2fRSX4ZVPWCkJQdBo8fF4W02qgkR3TshMhW1o
 R15D1jB0pLt/kq2eFntZlM0gv7AN/1pZAWk45MxvwNZ/u7yjzgGpBV5zNZ3KiEDEIQGB
 +emw2Qq+mz8DHg34meDaC2xMKJRKXRnT9iLku7GKE+PAQtmtJdX1MePu2LRsFTvBSVZu
 R6GQ6gS78wnRuTFXhRzU8P5k4FYkSu/wW1w4I3p4OuM0vsk5rbQEmuvrwCUAoHY/ZLB7
 e+hhhMKUV5qe07Rx3S6Yj/acTK+4ta2lMcNIcYz7viRycp5QqgNyvC72vkWE2XPPH6hK
 zSwQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1700060800; x=1700665600;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=wepq5yXq6ZDxa/f/BwIKVrMs3UB2LDVcpVMo6pPamL0=;
 b=n72HFn0SCmbNYxRFCBkYJhX33OxzH376xH4LQxjRBucWIC0gec0ATWEQWgoffRW80Z
 8exka7no/yLpIvhkQ+vu1OWegIS6rQlTsCkW+sl8DRsR/HKmczTcrJ//8cNvHW7why0f
 3UQ0l5elSSy/8yIhasUQmVD00V9va26ZFiHF+M8FpN2tXxe5YTYOHayBUxhKcmhUK6Vl
 nDbSI6TZ26KO1+chaKocQ67dTPHKQVTdGIOQzF8SuWmHK8r0xIuaWH8enOWse9CyNGyO
 zh8LvqGJG1OJsKiu+OZ6PlvQ47yVqu5hG93xW8lg4eJrYh2HH/oxtBoTrj1tOGgL2g1F
 cghw==
X-Gm-Message-State: AOJu0YxqpEwPzpv43YgLHST7QU9fm/hhWjgnU1d+xm+NYfgzScqQY3O1
 ociDx+9EgMfRQnCyxoOutqPe6g==
X-Google-Smtp-Source: AGHT+IEVV4HIecXUEL/S1RUXXbKM02Ltq54SCHbq5sF35ACPjJh6lDQWYgUmd/7JNX92U7GqR+jO6g==
X-Received: by 2002:a17:90a:d348:b0:280:6cde:ecc2 with SMTP id
 i8-20020a17090ad34800b002806cdeecc2mr8262701pjx.11.1700060800158; 
 Wed, 15 Nov 2023 07:06:40 -0800 (PST)
Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141])
 by smtp.gmail.com with ESMTPSA id
 kn11-20020a17090b480b00b00279060a0fccsm6878518pjb.9.2023.11.15.07.06.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 15 Nov 2023 07:06:39 -0800 (PST)
Date: Wed, 15 Nov 2023 07:06:35 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Morten =?UTF-8?B?QnLDuHJ1cA==?= <mb@smartsharesystems.com>
Cc: "Dengdui Huang" <huangdengdui@huawei.com>, <dev@dpdk.org>,
 <ferruh.yigit@amd.com>, <lihuisong@huawei.com>, <fengchengwen@huawei.com>,
 <liuyonglong@huawei.com>
Subject: Re: [PATCH 02/43] eal: use rte strerror
Message-ID: <20231115070635.17153640@hermes.local>
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F026@smartserver.smartshare.dk>
References: <20231114082539.1858594-1-huangdengdui@huawei.com>
 <20231114082539.1858594-3-huangdengdui@huawei.com>
 <20231114162254.7c065d56@hermes.local>
 <98CBD80474FA8B44BF855DF32C47DC35E9F026@smartserver.smartshare.dk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Wed, 15 Nov 2023 12:23:13 +0100
Morten Br=C3=B8rup <mb@smartsharesystems.com> wrote:

> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Wednesday, 15 November 2023 01.23
> >=20
> > On Tue, 14 Nov 2023 16:24:58 +0800
> > Dengdui Huang <huangdengdui@huawei.com> 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 <huangdengdui@huawei.com>
> > > Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> > > --- =20
> >=20
> > Look at implementation of rte_strerror(), it still has issues if
> > used from non-DPDK registered threads. =20
>=20
> The macro names RTE_DEFINE_PER_LCORE() and RTE_PER_LCORE() strongly indic=
ate that the variables are instantiated per lcore.
>=20
> But they are not; they are instantiated per thread [1]:

So rte_strerror() is thread safe (good).
It make sense to use it, take back my original negative comments.
We could improve documentation of rte_strerror() to help.