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 B254145BB6; Thu, 24 Oct 2024 08:47:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0BC143384; Thu, 24 Oct 2024 08:47:32 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id AECC143378 for ; Thu, 24 Oct 2024 08:47:30 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4XYxHn72QLz10Mcq; Thu, 24 Oct 2024 14:45:25 +0800 (CST) Received: from dggpeml500011.china.huawei.com (unknown [7.185.36.84]) by mail.maildlp.com (Postfix) with ESMTPS id 0CD9B18009B; Thu, 24 Oct 2024 14:47:29 +0800 (CST) Received: from [10.67.121.193] (10.67.121.193) by dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 24 Oct 2024 14:47:28 +0800 Message-ID: <56ac151b-79e9-461e-9ace-83af7b602eff@huawei.com> Date: Thu, 24 Oct 2024 14:47:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 00/42] replace strerror Content-Language: en-US To: Stephen Hemminger CC: , , , , , , , , References: <20231114082539.1858594-44-huangdengdui@huawei.com> <20241023082852.2780488-1-huangdengdui@huawei.com> <20241023084237.4da0ae1b@hermes.local> From: huangdengdui In-Reply-To: <20241023084237.4da0ae1b@hermes.local> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.193] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500011.china.huawei.com (7.185.36.84) 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, Stephen Hemminger On 2024/10/23 23:42, Stephen Hemminger wrote: > On Wed, 23 Oct 2024 16:28:10 +0800 > Dengdui Huang wrote: > >> The function strerror() is insecure in a multi-thread environment. >> It is better to use rte_strerror() instead of strerror(). >> In this patchset, only the libs and drivers are modified. >> >> chang log: >> v3->v4 fix ci error >> v2->v3 drop patch "telemetry: replace strerror" due to compile fail >> v1-v2 fix ci error > > Even rte_strerror is not completely safe. It depends on the calling > thread being a registered lcore. As discussed earlier, it is still safe if used from non-DPDK registered threads[1]: #define RTE_DEFINE_PER_LCORE(type, name) \ __thread __typeof__(type) per_lcore_##name [1]: https://elixir.bootlin.com/dpdk/v23.11-rc3/source/lib/eal/include/rte_per_lcore.h#L37 > > It would be better to use a coccinelle script to do direct replacement > with strerror_r(). > > Also, rte_strerror is not signal safe. Can we use strerror_r() in the signal processing context and replace it with rte_strerror() everywhere else?