[PATCH v4] eal: allow worker lcore stacks to be allocated from hugepage memory

Don Wallwork donw at xsightlabs.com
Tue May 24 15:48:58 CEST 2022


On 5/23/2022 6:35 PM, Kathleen Capella wrote:
> In this section of the code:
>
> stack_ptr = rte_zmalloc_socket("lcore_stack",
> 				       stack_size,
> 				       stack_size,
> 				       rte_lcore_to_socket_id(lcore_id));
>
> stack memory is aligned to the stack_size. According to the implementation of rte_zmalloc_socket, the alignment must be a power of two. If the user inputs a number of KBs that is not a power of two, this will fail with a generic error message of " EAL: Cannot allocate worker lcore stack memory." A check for this occurrence with a more descriptive error message and a note in the documentation would be good to include.
Good point.  Alignment to stack size is not necessary.  I'll post a new 
version that only requires cache line alignment.


More information about the dev mailing list