lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b1a1979a-424a-4590-9f44-236d4f9a2f58@intel.com>
Date: Fri, 20 Jun 2025 15:46:49 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Arnd Bergmann <arnd@...nel.org>
CC: Tony Nguyen <anthony.l.nguyen@...el.com>, Przemek Kitszel
	<przemyslaw.kitszel@...el.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
 S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, "Jakub
 Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Arnd Bergmann
	<arnd@...db.de>, Aleksandr Loktionov <aleksandr.loktionov@...el.com>, "Simon
 Horman" <horms@...nel.org>, <intel-wired-lan@...ts.osuosl.org>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH] ethernet: intel: fix building with
 large NR_CPUS

From: Arnd Bergmann <arnd@...nel.org>
Date: Fri, 20 Jun 2025 13:11:17 +0200

> From: Arnd Bergmann <arnd@...db.de>
> 
> With large values of CONFIG_NR_CPUS, three Intel ethernet drivers fail to
> compile like:
> 
> In function ‘i40e_free_q_vector’,
>     inlined from ‘i40e_vsi_alloc_q_vectors’ at drivers/net/ethernet/intel/i40e/i40e_main.c:12112:3:
>   571 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> include/linux/rcupdate.h:1084:17: note: in expansion of macro ‘BUILD_BUG_ON’
>  1084 |                 BUILD_BUG_ON(offsetof(typeof(*(ptr)), rhf) >= 4096);    \
> drivers/net/ethernet/intel/i40e/i40e_main.c:5113:9: note: in expansion of macro ‘kfree_rcu’
>  5113 |         kfree_rcu(q_vector, rcu);
>       |         ^~~~~~~~~
> 
> The problem is that the 'rcu' member in 'q_vector' is too far from the start
> of the structure. Move this member before the CPU mask instead, in all three
> drivers.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/net/ethernet/intel/fm10k/fm10k.h | 2 +-
>  drivers/net/ethernet/intel/i40e/i40e.h   | 2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
> index 6119a4108838..757a6fd81b7b 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k.h
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
> @@ -187,6 +187,7 @@ struct fm10k_q_vector {
>  	u32 __iomem *itr;	/* pointer to ITR register for this vector */
>  	u16 v_idx;		/* index of q_vector within interface array */
>  	struct fm10k_ring_container rx, tx;
> +	struct rcu_head rcu;	/* to avoid race with update stats on free */
>  
>  	struct napi_struct napi;

I'd place it *after* ::napi as the latter is hot and better to still be
near rx/tx etc.

Same for the rest of the drivers.

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ