Re: [PATCH v2 1/1] ice: Change assigning method of the CPU affinity masks

From: Andy Shevchenko
Date: Thu Feb 16 2023 - 10:17:28 EST


On Thu, Feb 16, 2023 at 03:54:55PM +0100, Pawel Chmielewski wrote:
> With the introduction of sched_numa_hop_mask() and for_each_numa_hop_mask(),
> the affinity masks for queue vectors can be conveniently set by preferring the
> CPUs that are closest to the NUMA node of the parent PCI device.

...

> + v_idx = 0;

> +

Redundant blank line.

> + for_each_numa_hop_mask(aff_mask, numa_node) {
> + for_each_cpu_andnot(cpu, aff_mask, last_aff_mask) {
> + if (v_idx >= vsi->num_q_vectors)

> + goto out;

Useless. You can return 0; here.

> + if (cpu_online(cpu)) {
> + cpumask_set_cpu(cpu, &vsi->q_vectors[v_idx]->affinity_mask);
> + v_idx++;
> + }
> + }
> +
> + last_aff_mask = aff_mask;
> + }
> +
> +out:
> return 0;

--
With Best Regards,
Andy Shevchenko