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: <20250305162636.cQf23qHf@linutronix.de>
Date: Wed, 5 Mar 2025 17:26:36 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Andrew Lunn <andrew@...n.ch>
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 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
 
 /* The whole frag API block must stay within one cacheline. On 32-bit systems,
  * sizeof(long) == sizeof(int), so that the block size is ``3 * sizeof(long)``.
  * On 64-bit systems, the actual size is ``2 * sizeof(long) + sizeof(int)``.

> 	Andrew

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ