Subject: Re: [PATCH 01/11] xfrm: Add support for per cpu xfrm state handling.

From: Jakub Kicinski <[email-masked]>
Date: Fri, 15 Nov 2024 18:09:08 -0800

On Fri, 15 Nov 2024 09:33:33 +0100 Steffen Klassert wrote:
> +	/* We need the cpu id just as a lookup key,
> +	 * we don't require it to be stable.
> +	 */
> +	pcpu_id = get_cpu();
> +	put_cpu();

Why not smp_processor_id() ?

> +	if (attrs[XFRMA_SA_PCPU]) {
> +		x->pcpu_num = nla_get_u32(attrs[XFRMA_SA_PCPU]);
> +		if (x->pcpu_num >= num_possible_cpus())
> +			goto error;
> +	}

cpu ids can be sparse, shouldn't it be checking if the CPU is online ?