[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YlQenv0v/7munOfN@lore-desk>
Date: Mon, 11 Apr 2022 14:27:10 +0200
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, lorenzo.bianconi@...hat.com,
davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
thomas.petazzoni@...tlin.com, linux@...linux.org.uk,
jbrouer@...hat.com, ilias.apalodimas@...aro.org, jdamato@...tly.com
Subject: Re: [PATCH v3 net-next 1/2] net: page_pool: introduce ethtool stats
> > diff --git a/include/net/page_pool.h b/include/net/page_pool.h
> > index ea5fb70e5101..94b2d666db03 100644
> > --- a/include/net/page_pool.h
> > +++ b/include/net/page_pool.h
> > @@ -117,6 +117,10 @@ struct page_pool_stats {
> > struct page_pool_recycle_stats recycle_stats;
> > };
> >
> > +int page_pool_ethtool_stats_get_count(void);
> > +u8 *page_pool_ethtool_stats_get_strings(u8 *data);
> > +u64 *page_pool_ethtool_stats_get(u64 *data, struct page_pool_stats *stats);
> > +
> > /*
> > * Drivers that wish to harvest page pool stats and report them to users
> > * (perhaps via ethtool, debugfs, or another mechanism) can allocate a
>
> You could also add stub function here for when the page pool
> statistics are disabled. We can then avoid all the messy #ifdef in the
> drivers.
>
> > +u64 *page_pool_ethtool_stats_get(u64 *data, struct page_pool_stats *stats)
> > +{
> > + int i;
> > +
> > + for (i = 0; i < ARRAY_SIZE(pp_stats); i++) {
> > + *data++ = stats->alloc_stats.fast;
> > + *data++ = stats->alloc_stats.slow;
> > + *data++ = stats->alloc_stats.slow_high_order;
> > + *data++ = stats->alloc_stats.empty;
> > + *data++ = stats->alloc_stats.refill;
> > + *data++ = stats->alloc_stats.waive;
> > + *data++ = stats->recycle_stats.cached;
> > + *data++ = stats->recycle_stats.cache_full;
> > + *data++ = stats->recycle_stats.ring;
> > + *data++ = stats->recycle_stats.ring_full;
> > + *data++ = stats->recycle_stats.released_refcnt;
> > + }
> > +
> > + return data;
>
> What is the purpose of the loop?
ops sorry, you are right. I will fix it.
Regards,
Lorenzo
>
> Andrew
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists