From: huangdengdui <huangdengdui@huawei.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: Stephen Hemminger <stephen@networkplumber.org>, <dev@dpdk.org>,
<ferruh.yigit@amd.com>, <mb@smartsharesystems.com>,
<david.marchand@redhat.com>, <iboukris@gmail.com>,
<lihuisong@huawei.com>, <fengchengwen@huawei.com>,
<haijie1@huawei.com>, <liuyonglong@huawei.com>
Subject: Re: [PATCH v4 00/42] replace strerror
Date: Fri, 1 Nov 2024 17:16:28 +0800 [thread overview]
Message-ID: <4677c933-b60b-462d-b7bc-2e9ca345edfe@huawei.com> (raw)
In-Reply-To: <4609477.bm5RmrZB5H@thomas>
On 2024/10/26 5:56, Thomas Monjalon wrote:
> 24/10/2024 08:47, huangdengdui:
>> On 2024/10/23 23:42, Stephen Hemminger wrote:
>>> On Wed, 23 Oct 2024 16:28:10 +0800
>>> Dengdui Huang <huangdengdui@huawei.com> 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.
>>>
>>> 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?
>
> It does not make sense to use rte_strerror after libc functions.
> Please restrict the use of rte_strerror for error numbers from DPDK functions.
>
>
The Windows platform does not support strerror_r(). Using strerror_r() instead of strerror() is not a good idea,
Platform differences have been handled in rte_strerror()[1].
The rte_strerror() can also handle errno from libc functions[2][3].
So is it better to use rte_strerror() instead of strerror()?
[1]https://elixir.bootlin.com/dpdk/v23.11-rc3/source/lib/eal/common/eal_common_errno.c#L15
[2]https://elixir.bootlin.com/dpdk/v23.11-rc3/source/lib/eal/common/eal_common_errno.c#L49
[3]https://elixir.bootlin.com/dpdk/v23.11-rc3/source/lib/eal/include/rte_errno.h#L32
next prev parent reply other threads:[~2024-11-01 9:16 UTC|newest]
Thread overview: 190+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 8:24 [PATCH 00/43] " Dengdui Huang
2023-11-14 8:24 ` [PATCH 01/43] devtools: forbid use of strerror Dengdui Huang
2023-11-14 8:24 ` [PATCH 02/43] eal: use rte strerror Dengdui Huang
2023-11-15 0:18 ` Stephen Hemminger
2023-11-15 11:16 ` Morten Brørup
2024-02-01 21:49 ` Stephen Hemminger
2023-11-15 0:22 ` Stephen Hemminger
2023-11-15 11:23 ` Morten Brørup
2023-11-15 15:06 ` Stephen Hemminger
2023-11-14 8:24 ` [PATCH 03/43] eventdev: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 04/43] latency: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 05/43] node: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 06/43] pdump: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 07/43] power: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 08/43] telemetry: replace strerror Dengdui Huang
2023-11-14 8:25 ` [PATCH 09/43] vhost: use rte strerror Dengdui Huang
2023-11-14 8:25 ` [PATCH 10/43] bpf: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 11/43] bus/cdx: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 12/43] bus/dpaa: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 13/43] bus/fslmc: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 14/43] bus/pci: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 15/43] bus/vdev: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 16/43] bus/vmbus: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 17/43] common/cnxk: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 18/43] common/mlx5: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 19/43] crypto/caam_jr: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 20/43] dma/idxd: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 21/43] net/af_packet: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 22/43] net/bnxt: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 23/43] net/af_xdp: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 24/43] net/bonding: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 25/43] net/dpaa: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 26/43] net/dpaa2: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 27/43] net/enetfec: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 28/43] net/failsafe: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 29/43] net/i40e: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 30/43] net/ice: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 31/43] net/ixgbe: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 32/43] net/memif: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 33/43] net/mlx4: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 34/43] net/mlx5: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 35/43] net/qede: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 36/43] net/sfc: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 37/43] net/tap: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 38/43] net/vhost: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 39/43] net/virtio: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 40/43] raw/ifpga: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 41/43] vdpa/ifc: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 42/43] vdpa/mlx5: " Dengdui Huang
2023-11-14 8:25 ` [PATCH 43/43] vdpa/sfc: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 00/43] replace strerror Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 01/43] devtools: forbid use of strerror Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 02/43] eal: use rte strerror Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 03/43] eventdev: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 04/43] latency: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 05/43] node: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 06/43] pdump: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 07/43] power: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 08/43] telemetry: replace strerror Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 09/43] vhost: use rte strerror Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 10/43] bpf: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 11/43] bus/cdx: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 12/43] bus/dpaa: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 13/43] bus/fslmc: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 14/43] bus/pci: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 15/43] bus/vdev: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 16/43] bus/vmbus: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 17/43] common/cnxk: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 18/43] common/mlx5: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 19/43] crypto/caam_jr: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 20/43] dma/idxd: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 21/43] net/af_packet: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 22/43] net/bnxt: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 23/43] net/af_xdp: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 24/43] net/bonding: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 25/43] net/dpaa: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 26/43] net/dpaa2: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 27/43] net/enetfec: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 28/43] net/failsafe: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 29/43] net/i40e: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 30/43] net/ice: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 31/43] net/ixgbe: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 32/43] net/memif: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 33/43] net/mlx4: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 34/43] net/mlx5: " Dengdui Huang
2023-11-14 11:23 ` [PATCH v2 35/43] net/qede: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 36/43] net/sfc: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 37/43] net/tap: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 38/43] net/vhost: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 39/43] net/virtio: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 40/43] raw/ifpga: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 41/43] vdpa/ifc: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 42/43] vdpa/mlx5: " Dengdui Huang
2023-11-14 11:24 ` [PATCH v2 43/43] vdpa/sfc: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 00/42] replace strerror Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 01/42] devtools: forbid use of strerror Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 02/42] eal: use rte strerror Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 03/42] eventdev: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 04/42] latency: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 05/42] node: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 06/42] pdump: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 07/42] power: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 08/42] vhost: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 09/42] bpf: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 10/42] bus/cdx: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 11/42] bus/dpaa: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 12/42] bus/fslmc: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 13/42] bus/pci: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 14/42] bus/vdev: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 15/42] bus/vmbus: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 16/42] common/cnxk: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 17/42] common/mlx5: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 18/42] crypto/caam_jr: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 19/42] dma/idxd: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 20/42] net/af_packet: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 21/42] net/bnxt: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 22/42] net/af_xdp: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 23/42] net/bonding: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 24/42] net/dpaa: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 25/42] net/dpaa2: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 26/42] net/enetfec: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 27/42] net/failsafe: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 28/42] net/i40e: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 29/42] net/ice: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 30/42] net/ixgbe: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 31/42] net/memif: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 32/42] net/mlx4: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 33/42] net/mlx5: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 34/42] net/qede: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 35/42] net/sfc: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 36/42] net/tap: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 37/42] net/vhost: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 38/42] net/virtio: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 39/42] raw/ifpga: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 40/42] vdpa/ifc: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 41/42] vdpa/mlx5: " Dengdui Huang
2023-11-14 12:35 ` [PATCH v3 42/42] vdpa/sfc: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 00/42] replace strerror Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 01/42] devtools: forbid use of strerror Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 02/42] eal: use rte strerror Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 03/42] eventdev: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 04/42] latency: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 05/42] node: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 06/42] pdump: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 07/42] power: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 08/42] vhost: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 09/42] bpf: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 10/42] bus/cdx: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 11/42] bus/dpaa: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 12/42] bus/fslmc: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 13/42] bus/pci: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 14/42] bus/vdev: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 15/42] bus/vmbus: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 16/42] common/cnxk: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 17/42] common/mlx5: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 18/42] crypto/caam_jr: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 19/42] dma/idxd: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 20/42] net/af_packet: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 21/42] net/bnxt: " Dengdui Huang
2024-10-23 20:24 ` Ajit Khaparde
2024-10-23 8:28 ` [PATCH v4 22/42] net/af_xdp: " Dengdui Huang
2024-10-24 17:05 ` Maryam Tahhan
2024-10-23 8:28 ` [PATCH v4 23/42] net/bonding: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 24/42] net/dpaa: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 25/42] net/dpaa2: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 26/42] net/enetfec: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 27/42] net/failsafe: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 28/42] net/i40e: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 29/42] net/ice: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 30/42] net/ixgbe: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 31/42] net/memif: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 32/42] net/mlx4: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 33/42] net/mlx5: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 34/42] net/qede: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 35/42] net/sfc: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 36/42] net/tap: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 37/42] net/vhost: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 38/42] net/virtio: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 39/42] raw/ifpga: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 40/42] vdpa/ifc: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 41/42] vdpa/mlx5: " Dengdui Huang
2024-10-23 8:28 ` [PATCH v4 42/42] vdpa/sfc: " Dengdui Huang
2024-10-23 15:42 ` [PATCH v4 00/42] replace strerror Stephen Hemminger
2024-10-24 6:47 ` huangdengdui
2024-10-25 21:56 ` Thomas Monjalon
2024-11-01 9:16 ` huangdengdui [this message]
2024-10-29 1:16 ` lihuisong (C)
2023-11-15 0:16 ` [PATCH 00/43] " Stephen Hemminger
2024-02-01 11:03 ` David Marchand
2024-10-22 10:48 ` Morten Brørup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4677c933-b60b-462d-b7bc-2e9ca345edfe@huawei.com \
--to=huangdengdui@huawei.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=ferruh.yigit@amd.com \
--cc=haijie1@huawei.com \
--cc=iboukris@gmail.com \
--cc=lihuisong@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=mb@smartsharesystems.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).