From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, thomas.petazzoni@bootlin.com,
ilias.apalodimas@linaro.org, jbrouer@redhat.com,
jdamato@fastly.com
Subject: Re: [PATCH v2 net-next 2/2] net: mvneta: add support for page_pool_get_stats
Date: Fri, 8 Apr 2022 19:14:22 +0200 [thread overview]
Message-ID: <YlBtbqjblTO2EU6j@lore-desk> (raw)
In-Reply-To: <YlA7yQ0NZi94ob/Q@lunn.ch>
[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]
> > @@ -4732,9 +4732,13 @@ static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
> > if (sset == ETH_SS_STATS) {
> > int i;
> >
> > - for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++)
> > - memcpy(data + i * ETH_GSTRING_LEN,
> > - mvneta_statistics[i].name, ETH_GSTRING_LEN);
> > + for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++) {
> > + memcpy(data, mvneta_statistics[i].name,
> > + ETH_GSTRING_LEN);
> > + data += ETH_GSTRING_LEN;
> > + }
>
> You don't need to touch this loop, you can just do:
ack, it was just to avoid a long line, I will fix it.
>
> > +
> > + page_pool_ethtool_stats_get_strings(data +
> ETH_GSTRING_LEN * ARRAY_SIZE(mvneta_staticstics)));
> > }
> > }
> >
> > @@ -5392,6 +5412,14 @@ static int mvneta_probe(struct platform_device *pdev)
> > pp->rxq_def = rxq_def;
> > pp->indir[0] = rxq_def;
> >
> > + stats_len = ARRAY_SIZE(mvneta_statistics) +
> > + page_pool_ethtool_stats_get_count();
> > + pp->ethtool_stats = devm_kzalloc(&pdev->dev,
> > + sizeof(*pp->ethtool_stats) * stats_len,
> > + GFP_KERNEL);
>
> Why do you do this? The page_pool stats are never stored in
> pp->ethtool_stats.
ops, I need to drop this, thanks.
Regards,
Lorenzo
>
> Andrew
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2022-04-08 17:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 8:23 [PATCH v2 net-next 0/2] net: mvneta: add support for page_pool_get_stats Lorenzo Bianconi
2022-04-08 8:23 ` [PATCH v2 net-next 1/2] net: page_pool: introduce ethtool stats Lorenzo Bianconi
2022-04-08 13:33 ` Andrew Lunn
2022-04-08 13:45 ` Andrew Lunn
2022-04-08 17:14 ` Lorenzo Bianconi
2022-04-08 8:24 ` [PATCH v2 net-next 2/2] net: mvneta: add support for page_pool_get_stats Lorenzo Bianconi
2022-04-08 13:42 ` Andrew Lunn
2022-04-08 17:14 ` Lorenzo Bianconi [this message]
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=YlBtbqjblTO2EU6j@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=ilias.apalodimas@linaro.org \
--cc=jbrouer@redhat.com \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=thomas.petazzoni@bootlin.com \
/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;
as well as URLs for NNTP newsgroup(s).