Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Joe Damato <jdamato@fastly.com>,
	Leon Romanovsky <leon@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH net-next] net/mlnx5: Use generic code for page_pool statistics.
Date: Wed, 5 Mar 2025 17:26:36 +0100	[thread overview]
Message-ID: <20250305162636.cQf23qHf@linutronix.de> (raw)
In-Reply-To: <433b43b1-0a42-4606-b919-3429c36aa934@lunn.ch>

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

  reply	other threads:[~2025-03-05 16:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 12:14 [PATCH net-next] net/mlnx5: Use generic code for page_pool statistics Sebastian Andrzej Siewior
2025-03-05 16:21 ` Andrew Lunn
2025-03-05 16:26   ` Sebastian Andrzej Siewior [this message]
2025-03-05 17:43     ` Andrew Lunn
2025-03-05 18:52       ` Sebastian Andrzej Siewior
2025-03-05 19:44 ` Tariq Toukan
2025-03-05 20:20   ` Sebastian Andrzej Siewior
2025-03-06  6:49     ` Tariq Toukan
2025-03-06  7:38       ` Sebastian Andrzej Siewior
2025-03-06  8:32     ` Sebastian Andrzej Siewior
2025-03-06  9:50       ` Tariq Toukan
2025-03-06  9:56         ` Sebastian Andrzej Siewior
2025-03-06 10:22           ` Tariq Toukan
2025-03-06 10:38             ` Sebastian Andrzej Siewior
2025-03-06 11:10           ` Tariq Toukan
2025-03-06 13:16             ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250305162636.cQf23qHf@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox