[PATCH 02/43] eal: use rte strerror
Stephen Hemminger
stephen at networkplumber.org
Wed Nov 15 16:06:35 CET 2023
On Wed, 15 Nov 2023 12:23:13 +0100
Morten Brørup <mb at smartsharesystems.com> wrote:
> > From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> > Sent: Wednesday, 15 November 2023 01.23
> >
> > On Tue, 14 Nov 2023 16:24:58 +0800
> > Dengdui Huang <huangdengdui at huawei.com> wrote:
> >
> > > The function strerror() is insecure in a multi-thread environment.
> > > This patch uses rte_strerror() to replace it.
> > >
> > > Cc: stable at dpdk.org
> > >
> > > Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
> > > Acked-by: Chengwen Feng <fengchengwen at huawei.com>
> > > ---
> >
> > Look at implementation of rte_strerror(), it still has issues if
> > used from non-DPDK registered threads.
>
> The macro names RTE_DEFINE_PER_LCORE() and RTE_PER_LCORE() strongly indicate that the variables are instantiated per lcore.
>
> 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.
More information about the dev
mailing list