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] [thread-next>] [day] [month] [year] [list]
Message-ID: <86aaf4f3-9792-4d70-a16b-2f5fc7ce63a3@lunn.ch>
Date: Wed, 5 Mar 2025 18:43:39 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-rdma@...r.kernel.org, netdev@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Joe Damato <jdamato@...tly.com>,
	Leon Romanovsky <leon@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Saeed Mahameed <saeedm@...dia.com>,
	Tariq Toukan <tariqt@...dia.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH net-next] net/mlnx5: Use generic code for page_pool
 statistics.

On Wed, Mar 05, 2025 at 05:26:36PM +0100, Sebastian Andrzej Siewior wrote:
> On 2025-03-05 17:21:56 [+0100], Andrew Lunn wrote:
> > > @@ -276,6 +263,9 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(sw)
> > >  		mlx5e_ethtool_put_stat(data,
> > >  				       MLX5E_READ_CTR64_CPU(&priv->stats.sw,
> > >  							    sw_stats_desc, i));
> > > +#ifdef CONFIG_PAGE_POOL_STATS
> > > +	*data = page_pool_ethtool_stats_get(*data, &priv->stats.sw.page_pool_stats);
> > > +#endif
> > >  }
> > 
> > Are these #ifdef required? include/net/page_pool/helpers.h:
> > 
> > static inline u64 *page_pool_ethtool_stats_get(u64 *data, const void *stats)
> > {
> > 	return data;
> > }
> > 
> > Seems silly to have a stub if it cannot be used.
> 
> As I mentioned in the diffstat section, if we add the snippet below then
> it would work. Because the struct itself is not there.
> 
> diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
> index f45d55e6e8643..78984b9286c6b 100644
> --- a/include/net/page_pool/types.h
> +++ b/include/net/page_pool/types.h
> @@ -143,10 +143,14 @@ struct page_pool_recycle_stats {
>   */
>  struct page_pool_stats {
>  	struct page_pool_alloc_stats alloc_stats;
>  	struct page_pool_recycle_stats recycle_stats;
>  };
> +
> +#else /* !CONFIG_PAGE_POOL_STATS */
> +
> +struct page_pool_stats { };
>  #endif
  
Please do add this, in a separate patch. But i wounder how other
drivers handle this. Do they also have #ifdef?

    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ