DPDK patches and discussions
 help / color / mirror / Atom feed
From: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
To: Somnath Kotur <somnath.kotur@broadcom.com>
Cc: David Marchand <david.marchand@redhat.com>, dev <dev@dpdk.org>,
	 "Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH 1/4] net/bnxt: fix extended port counter statistics
Date: Thu, 25 Jul 2019 13:24:12 +0530	[thread overview]
Message-ID: <CAJr_i82J5MSoCMXv_C8F0GH52s0pROQwUB85jUfUx_wEavANJw@mail.gmail.com> (raw)
In-Reply-To: <CAOBf=mtGGxu4MVh_rBdFqEvGd81Lk4UGRq_xvWThAMb850Dq-g@mail.gmail.com>

On Thu, Jul 25, 2019 at 1:09 PM Somnath Kotur <somnath.kotur@broadcom.com>
wrote:

> +Santosh
>
> On Thu, Jul 25, 2019 at 12:52 PM David Marchand <david.marchand@redhat.com>
> wrote:
>
>> On Thu, Jul 25, 2019 at 7:05 AM Somnath Kotur
>> <somnath.kotur@broadcom.com> wrote:
>> >
>> > From: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
>> >
>> > We were trying to fill in more rx extended stats than the size allocated
>> > for stats causing segfault. Fixed this by adding an explicit check.
>> > Rearranged the code to return statistic values in xstats_get as per the
>> > names returned in xstats_get_names.
>> >
>> > Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
>> >
>> > Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
>> > Signed-off-by: Santoshkumar Karanappa Rastapur <
>> santosh.rastapur@broadcom.com>
>> > Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
>> > ---
>> >  drivers/net/bnxt/bnxt_stats.c | 24 ++++++++++++++----------
>> >  1 file changed, 14 insertions(+), 10 deletions(-)
>> >
>> > diff --git a/drivers/net/bnxt/bnxt_stats.c
>> b/drivers/net/bnxt/bnxt_stats.c
>> > index 4e74f8a..69ac2dd 100644
>> > --- a/drivers/net/bnxt/bnxt_stats.c
>> > +++ b/drivers/net/bnxt/bnxt_stats.c
>>
>> [snip]
>>
>> > @@ -463,22 +467,22 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev
>> *eth_dev,
>> >         xstats[count].value = rte_le_to_cpu_64(tx_drop_pkts);
>> >         count++;
>> >
>> > -       for (i = 0; i < tx_port_stats_ext_cnt; i++) {
>> > -               uint64_t *tx_stats_ext = (uint64_t
>> *)bp->hw_tx_port_stats_ext;
>> > +       for (i = 0; i < rx_port_stats_ext_cnt; i++) {
>> > +               uint64_t *rx_stats_ext = (uint64_t
>> *)bp->hw_rx_port_stats_ext;
>> >
>> >                 xstats[count].value = rte_le_to_cpu_64
>> > -                                       (*(uint64_t *)((char
>> *)tx_stats_ext +
>> > -
>> bnxt_tx_ext_stats_strings[i].offset));
>> > +                                       (*(uint64_t *)((char
>> *)rx_stats_ext +
>> > +
>> bnxt_rx_ext_stats_strings[i].offset));
>> >
>> >                 count++;
>> >         }
>> >
>> > -       for (i = 0; i < rx_port_stats_ext_cnt; i++) {
>> > -               uint64_t *rx_stats_ext = (uint64_t
>> *)bp->hw_rx_port_stats_ext;
>> > +       for (i = 0; i < tx_port_stats_ext_cnt; i++) {
>> > +               uint64_t *tx_stats_ext = (uint64_t
>> *)bp->hw_tx_port_stats_ext;
>> >
>> >                 xstats[count].value = rte_le_to_cpu_64
>> > -                                       (*(uint64_t *)((char
>> *)rx_stats_ext +
>> > -
>> bnxt_rx_ext_stats_strings[i].offset));
>> > +                                       (*(uint64_t *)((char
>> *)tx_stats_ext +
>> > +
>> bnxt_tx_ext_stats_strings[i].offset));
>> >
>> >                 count++;
>> >         }
>> > --
>> > 1.8.3.1
>> >
>>
>> This whole hunk just adds some noise, right? or is there anything fixed
>> in it?
>>
>>
>> --
>> David Marchand
>>
>

In bnxt_dev_xstats_get_names_op, we were filling statistics names in
xstats_names in this order.

                bnxt_rx_stats_strings

                bnxt_tx_stats_strings

                bnxt_rx_ext_stats_strings

                bnxt_tx_ext_stats_strings



Where as in bnxt_dev_xstats_get_op, we were returning stats values in
xstats in this order.

                bnxt_rx_stats_strings

                bnxt_tx_stats_strings

                bnxt_tx_ext_stats_strings

                bnxt_rx_ext_stats_strings



We were ending up displaying extended Tx stats values against extended Rx
stats names and vice versa.

This above code fixes this order.

Regards
-Santosh

  reply	other threads:[~2019-07-25 22:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  4:59 [dpdk-dev] [PATCH v2 0/4] bnxt patches Somnath Kotur
2019-07-25  4:59 ` [dpdk-dev] [PATCH 1/4] net/bnxt: fix extended port counter statistics Somnath Kotur
2019-07-25  7:21   ` David Marchand
2019-07-25  7:40     ` Somnath Kotur
2019-07-25  7:54       ` Santoshkumar Karanappa Rastapur [this message]
2019-07-25  7:57         ` David Marchand
2019-07-25  7:37   ` Somnath Kotur
2019-07-25  4:59 ` [dpdk-dev] [PATCH 2/4] net/bnxt: fix to use chimp hwrm channel for few commands Somnath Kotur
2019-07-25  4:59 ` [dpdk-dev] [PATCH 3/4] net/bnxt: fix endianness issue Somnath Kotur
2019-07-25  4:59 ` [dpdk-dev] [PATCH 4/4] net/bnxt: reduce verbosity of a message Somnath Kotur
2019-07-25 15:57 ` [dpdk-dev] [PATCH v2 0/4] bnxt patches Ferruh Yigit

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=CAJr_i82J5MSoCMXv_C8F0GH52s0pROQwUB85jUfUx_wEavANJw@mail.gmail.com \
    --to=santosh.rastapur@broadcom.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=somnath.kotur@broadcom.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).