From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: "Ouyang,
Changchun"
<changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH] virtio: Fix stats issue
Date: Mon, 23 Mar 2015 11:42:10 +0100 [thread overview]
Message-ID: <11509543.rOgWUoKvXr@xps13> (raw)
In-Reply-To: <550FD107.8060109-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-23 16:38, Ouyang, Changchun:
> On 3/23/2015 3:20 PM, David Marchand wrote:
> > On Mon, Mar 23, 2015 at 7:56 AM, Ouyang Changchun
> > <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org <mailto:changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>> wrote:
> >
> > It need clear/reset the stats information before count in all
> > queues data.
> >
> > Signed-off-by: Changchun Ouyang <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
> > <mailto:changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>>
> > ---
> > lib/librte_pmd_virtio/virtio_ethdev.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c
> > b/lib/librte_pmd_virtio/virtio_ethdev.c
> > index 603be2d..e4cb55e 100644
> > --- a/lib/librte_pmd_virtio/virtio_ethdev.c
> > +++ b/lib/librte_pmd_virtio/virtio_ethdev.c
> > @@ -572,6 +572,10 @@ virtio_dev_stats_get(struct rte_eth_dev *dev,
> > struct rte_eth_stats *stats)
> > {
> > unsigned i;
> >
> > + stats->opackets = 0;
> > + stats->obytes = 0;
> > + stats->oerrors = 0;
> >
> >
> > stats are supposed to be zero'd in generic rte_ethdev.c before this
> > pmd function is called, so this patch seems useless to me.
> > Can you give some context ?
> >
> > Same comment for the i* part.
> >
> 2 reasons:
> 1. this change could keep the stats_get has consistent behavior with the
> one in other drivers;
If there are some useless reset in other drivers, they should be removed.
> 2. we don't rely on the assumption of caller always zero'd the stats,
> and still can return correct value;
The caller is ethdev and it is zero'ing the structure before the call:
http://dpdk.org/browse/dpdk/commit/?id=02331c16ec0
next prev parent reply other threads:[~2015-03-23 10:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 6:56 [PATCH] virtio: Fix stats issue Ouyang Changchun
[not found] ` <1427093798-23078-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-23 7:20 ` David Marchand
[not found] ` <CALwxeUsH_8dx5KPYnD1BCWw0mC7nC6dqb9f9t0pF3Q0KoibCQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-23 8:38 ` Ouyang, Changchun
[not found] ` <550FD107.8060109-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-23 10:42 ` Thomas Monjalon [this message]
2015-03-23 22:53 ` Stephen Hemminger
2015-03-27 14:26 ` Ouyang, Changchun
[not found] ` <F52918179C57134FAEC9EA62FA2F962511A78AD9-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-27 15:25 ` Thomas Monjalon
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=11509543.rOgWUoKvXr@xps13 \
--to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
--cc=changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.org \
/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).