Re: [PATCH 1/1] ice: Change assigning method of the CPU affinity masks
From: Andy Shevchenko
Date: Wed Feb 08 2023 - 11:59:05 EST
On Wed, Feb 08, 2023 at 08:39:20AM -0800, Yury Norov wrote:
> On Wed, Feb 08, 2023 at 04:39:05PM +0100, Pawel Chmielewski wrote:
...
> > + v_idx = 0;
> > + 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) {
> > + if (cpu_online(cpu))
> > + cpumask_set_cpu(cpu, &vsi->q_vectors[v_idx]->affinity_mask);
> > + v_idx++;
> > + }
> else
> goto out;
In this case the inverted conditional makes more sense:
if (v_idx >= vsi->num_q_vectors)
goto out;
if (cpu_online(cpu))
cpumask_set_cpu(cpu, &vsi->q_vectors[v_idx]->affinity_mask);
v_idx++;
(indentation level will be decreased).
> > + last_aff_mask = aff_mask;
> > + }
> > +
> out:
>
> > return 0;
--
With Best Regards,
Andy Shevchenko