public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel•org>
To: Andrew Lunn <andrew@lunn•ch>
Cc: netdev@vger•kernel.org, lorenzo.bianconi@redhat•com,
	davem@davemloft•net, kuba@kernel•org, pabeni@redhat•com,
	thomas.petazzoni@bootlin•com, linux@armlinux•org.uk,
	jbrouer@redhat•com, ilias.apalodimas@linaro•org,
	jdamato@fastly•com
Subject: Re: [PATCH v3 net-next 1/2] net: page_pool: introduce ethtool stats
Date: Mon, 11 Apr 2022 14:27:10 +0200	[thread overview]
Message-ID: <YlQenv0v/7munOfN@lore-desk> (raw)
In-Reply-To: <YlQXl2a6vctIxXuP@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]

> > 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2022-04-11 12:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09 18:39 [PATCH v3 net-next 0/2] net: mvneta: add support for page_pool_get_stats Lorenzo Bianconi
2022-04-09 18:39 ` [PATCH v3 net-next 1/2] net: page_pool: introduce ethtool stats Lorenzo Bianconi
2022-04-11 11:57   ` Andrew Lunn
2022-04-11 12:27     ` Lorenzo Bianconi [this message]
2022-04-11 12:06   ` Ilias Apalodimas
2022-04-11 12:28     ` Lorenzo Bianconi
2022-04-11 12:34       ` Ilias Apalodimas
2022-04-11 12:46         ` Lorenzo Bianconi
2022-04-11 12:49         ` Andrew Lunn
2022-04-11 12:51           ` Ilias Apalodimas
2022-04-09 18:39 ` [PATCH v3 net-next 2/2] net: mvneta: add support for page_pool_get_stats Lorenzo Bianconi
2022-04-11 11:58   ` Andrew Lunn

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=YlQenv0v/7munOfN@lore-desk \
    --to=lorenzo@kernel$(echo .)org \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=ilias.apalodimas@linaro$(echo .)org \
    --cc=jbrouer@redhat$(echo .)com \
    --cc=jdamato@fastly$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux@armlinux$(echo .)org.uk \
    --cc=lorenzo.bianconi@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=thomas.petazzoni@bootlin$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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