From: "Tahhan, Maryam" <maryam.tahhan@intel.com>
To: "Tahhan, Maryam" <maryam.tahhan@intel.com>,
Olivier MATZ <olivier.matz@6wind.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 2/7] ixgbe: add functions to get and reset xstats
Date: Sun, 5 Jul 2015 10:02:40 +0000 [thread overview]
Message-ID: <1A27633A6DA49C4A92FCD5D4312DBF536A45ADE9@IRSMSX109.ger.corp.intel.com> (raw)
In-Reply-To: <1A27633A6DA49C4A92FCD5D4312DBF536A45ADD4@IRSMSX109.ger.corp.intel.com>
>
>
> <snip>
> > >
> > >> +
> > >> + total_missed_rx = 0;
> > >> + total_qbrc = 0;
> > >> + total_qprc = 0;
> > >> + total_qprdc = 0;
> > >> + rxnfgpc = 0;
> > >> + txdgpc = 0;
> > >> + count = 0;
> > >> +
> > >> + ixgbe_read_stats_registers(hw, hw_stats, &total_missed_rx,
> > &total_qbrc,
> > >> + &total_qprc,
> > &rxnfgpc, &txdgpc, &total_qprdc);
> > >> +
> > >> + if (!xstats)
> > >> + return 0;
> > >
> > > this cannot happen except if n == 0.
> > > This condition is already tested above, and "count" should be returned.
> > >
> > >> +
> > >> + /* Error stats */
> > >> + for (i = 0; i < RTE_NB_XSTATS; i++) {
> > >> + snprintf(xstats[count].name, sizeof(xstats[count].name),
> > >> + "%s", rte_ixgbe_stats_strings[i].name);
> > >> + xstats[count++].value = *(uint64_t *)(((char *)hw_stats) +
> > >> +
> > rte_ixgbe_stats_strings[i].offset);
> > >> + }
> > >> +
> > >> + return count;
> > >> +}
> > >
> > > Shouldn't it be xstats[i] instead of xstats[count] ?
> > >
> > > Does it work when using "show port in test-pmd"?
> >
> > ok I missed the 'count = 0' above.
> > So why using count instead of i ?
> >
> > Also, I think it would be clearer to use the constant IXGBE_NB_XSTATS
> > instead of count at the beginning of the function.
> >
> >
>
> Hi Olivier
>
> Actually, count should not be 0, it should be n, which is the passed in index
> from rte_eth_xstats_get()...
>
> Because we fill out the generic stats first in rte_eth_xstats_get() then we call
> ixgbe_dev_xstats_get to fill out the rest.
>
> I will fix this up
Hi Olivier,
I confused this change with a subsequent patch in the patch set... so yes for this patch you are correct we can just use i... and leave count as 0.
in a subsequent patch I modify count to start at n, which is a passed in index from in rte_eth_xstats_get()...
so I will change count for i in the loop here.
> > >
> > >> +
> > >> +static void
> > >> +ixgbe_dev_xstats_reset(struct rte_eth_dev *dev) {
> > >> + struct ixgbe_hw_stats *stats =
> > >> + IXGBE_DEV_PRIVATE_TO_STATS(dev->data-
> > >dev_private);
> > >> +
> > >> + /* HW registers are cleared on read */
> > >> + ixgbe_dev_xstats_get(dev, NULL, RTE_NB_XSTATS);
> > >> +
> > >> + /* Reset software totals */
> > >> + memset(stats, 0, sizeof(*stats)); }
> > >> +
> > >> static void
> > >> ixgbevf_dev_stats_get(struct rte_eth_dev *dev, struct
> > >> rte_eth_stats
> > >> *stats) {
> > >>
next prev parent reply other threads:[~2015-07-05 10:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 12:59 [dpdk-dev] [PATCH v3 0/7] Expose IXGBE extended stats to DPDK apps Maryam Tahhan
2015-06-26 12:59 ` [dpdk-dev] [PATCH v3 1/7] ixgbe: move stats register reads to a new function Maryam Tahhan
2015-06-26 12:59 ` [dpdk-dev] [PATCH v3 2/7] ixgbe: add functions to get and reset xstats Maryam Tahhan
2015-07-03 13:16 ` Olivier MATZ
2015-07-03 13:19 ` Olivier MATZ
2015-07-05 9:34 ` Tahhan, Maryam
2015-07-05 10:02 ` Tahhan, Maryam [this message]
2015-07-05 9:27 ` Tahhan, Maryam
2015-06-26 12:59 ` [dpdk-dev] [PATCH v3 3/7] ethdev: expose extended error stats Maryam Tahhan
2015-07-03 13:27 ` Olivier MATZ
2015-06-26 12:59 ` [dpdk-dev] [PATCH v3 4/7] ethdev: remove HW specific stats in stats structs Maryam Tahhan
2015-06-26 14:03 ` Kyle Larose
2015-06-26 14:30 ` Tahhan, Maryam
2015-06-26 14:37 ` Kyle Larose
2015-06-26 14:47 ` Tahhan, Maryam
2015-06-26 12:59 ` [dpdk-dev] [PATCH v3 5/7] ixgbe: add NIC specific stats removed from ethdev Maryam Tahhan
2015-06-26 12:59 ` [dpdk-dev] [PATCH v3 6/7] app: remove dump_cfg Maryam Tahhan
2015-06-26 12:59 ` [dpdk-dev] [PATCH v3 7/7] app: add a new app proc_info Maryam Tahhan
2015-07-01 14:27 ` [dpdk-dev] [PATCH v3 0/7] Expose IXGBE extended stats to DPDK apps Tahhan, Maryam
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=1A27633A6DA49C4A92FCD5D4312DBF536A45ADE9@IRSMSX109.ger.corp.intel.com \
--to=maryam.tahhan@intel.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.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).