[PATCH v1 1/1] eal/random: fix random state initialization for non-eal threads

Mattias Rönnblom hofors at lysator.liu.se
Mon Oct 2 14:22:25 CEST 2023


On 2023-10-02 10:25, David Marchand wrote:
> Hello guys,
> 
> On Mon, Aug 28, 2023 at 2:07 PM Anatoly Burakov
> <anatoly.burakov at intel.com> wrote:
>>
>> Currently, the rte_rand() state is initialized with seed, and each
>> rand state is initialized up until RTE_MAX_LCORE'th rand state. However,
>> rand state also has one extra rand state reserved for non-EAL threads,
>> which is not initialized. Fix it by initializing this extra state.
>>
>> Fixes: 3f002f069612 ("eal: replace libc-based random generation with LFSR")
>> Cc: mattias.ronnblom at ericsson.com
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> 
> We have two series for fixing related issues.
> 
> Stephen alternative patch 1 handles Anatoly fix here.
> https://patchwork.dpdk.org/project/dpdk/list/?series=29449&state=%2A&archive=both
> 
> I see Anatoly was acked by Mattias and Morten, though Stephen
> (RTE_DIM) fix is more elegant.

Stephen hadn't posted his fix when I acked this, I believe.

RTE_DIM() makes the thing more readable. I'm fine with either 
"RTE_MAX_LCORE + 1" or "RTE_DIM()", but I would prefer the latter.

> How do you guys want me to proceed?
> 
> 
> Thanks.


More information about the stable mailing list