Re: [PATCH net-next] net/mlnx5: Use generic code for page_pool statistics.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux