[dpdk-stable] [PATCH v2] eal/windows: ensure all enabled CPUs are counted

Kadam, Pallavi pallavi.kadam at intel.com
Wed Aug 4 22:40:24 CEST 2021


On 6/29/2021 6:56 PM, Narcisa Ana Maria Vasile wrote:
> From: Narcisa Vasile <navasile at microsoft.com>
>
> rte_cpuset_t describes a set of CPUs by using an array of masks
> named '_bits'. Each element in the '_bits' array represents
> a bit mask, with each bit corresponding to a CPU.
> The maximum number of CPUs is given by 'CPU_SETSIZE'.
> The number of bit masks is computed using '_NUM_SETS(CPU_SETSIZE)'.
>
> count_cpu() should count the number of CPUs enabled in the set 's'.
> Currently, it iterates through the number of masks in the
> set 's', instead of iterating through all the bits in all the masks.
> For example, if '_NUM_SETS(CPU_SETSIZE)' returns 2,
> which means there are 2 bit masks: _bits[0] and _bits[1],
> count_cpu() would only check if CPUs '0' and '1' are enabled.
> The correct behavior is to iterate through all the CPUs in the set and
> count the ones that are enabled.
>
> This patch fixes count_cpu() to ensure all the bits in all the masks
> are checked to compute the correct number of CPUs enabled in 's'.
>
> Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")
> Cc: pallavi.kadam at intel.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Narcisa Vasile <navasile at microsoft.com>
> ---
Acked-by: Pallavi Kadam <pallavi.kadam at intel.com>


More information about the stable mailing list