[PATCH v3 3/4] eal: implement functions for get/set thread affinity
David Marchand
david.marchand at redhat.com
Mon Apr 25 10:26:58 CEST 2022
On Wed, Apr 13, 2022 at 9:43 AM Tyler Retzlaff
<roretzla at linux.microsoft.com> wrote:
>
> Implement functions for getting/setting thread affinity.
> Threads can be pinned to specific cores by setting their
> affinity attribute.
>
> note: rte_convert_cpuset_to_affinity has a limitation that all cpus of
> the set belong to the same processor group.
>
> Signed-off-by: Narcisa Vasile <navasile at microsoft.com>
> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
[snip]
> diff --git a/lib/eal/windows/rte_thread.c b/lib/eal/windows/rte_thread.c
> index d730bb4..032b09f 100644
> --- a/lib/eal/windows/rte_thread.c
> +++ b/lib/eal/windows/rte_thread.c
> @@ -6,7 +6,8 @@
> #include <rte_common.h>
> #include <rte_errno.h>
> #include <rte_thread.h>
> -#include <rte_windows.h>
> +
> +#include "eal_windows.h"
>
> struct eal_tls_key {
> DWORD thread_index;
> @@ -146,3 +147,131 @@ struct eal_tls_key {
> }
> return output;
> }
> +
> +static int
> +rte_convert_cpuset_to_affinity(const rte_cpuset_t *cpuset,
> + PGROUP_AFFINITY affinity)
This is Windows only, static code.
Please don't use rte_ prefix.
For static code, I see no need for a prefix at all.
--
David Marchand
More information about the dev
mailing list