> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> Sent: Wednesday, 15 November 2023 01.23
> 
> On Tue, 14 Nov 2023 16:24:58 +0800
> Dengdui Huang <huangdeng...@huawei.com> wrote:
> 
> > The function strerror() is insecure in a multi-thread environment.
> > This patch uses rte_strerror() to replace it.
> >
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: Dengdui Huang <huangdeng...@huawei.com>
> > Acked-by: Chengwen Feng <fengcheng...@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]:

#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

Reply via email to