From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A636BA046B for ; Fri, 26 Jul 2019 00:39:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 515231C395; Fri, 26 Jul 2019 00:39:23 +0200 (CEST) Received: from mail-yb1-f195.google.com (mail-yb1-f195.google.com [209.85.219.195]) by dpdk.org (Postfix) with ESMTP id 7EE591C295 for ; Thu, 25 Jul 2019 09:54:24 +0200 (CEST) Received: by mail-yb1-f195.google.com with SMTP id j199so18210387ybg.5 for ; Thu, 25 Jul 2019 00:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yATNNoI3AIn32VFEaa8lKkY0pWibMLFWC6ER/KT8gek=; b=b8ddr/JYtzmYjs6qNu21DFPo3DidiRprH/9zbiXiL/k+m5mDEJXlwjbVOLbCqa7XHD LnkoS3vXl3AGHkXuNAcCnoFYHQWgC3fNZQDRuMuru4u9wOWGdYLkI7zMGIuUpswlE5jk Chbg8dw5gHq5GLGvSoid/ToVcqQB+iwxxjnJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yATNNoI3AIn32VFEaa8lKkY0pWibMLFWC6ER/KT8gek=; b=iq8Eu545pSBnT1rTvpkMi2K6YNMO9GMg/mJrsmi6dxlTSM4usgxxov+xj6kUKtNWbq 3R6XuT+59OLQCcEQqt5rPv7D/4p0cCdn/v1o2kmk4ljM7E4iqwNeTMpxE42/MC/6auw3 6qSOF7j4EZzrENo853qSfOhVKmKV0BJwEsvwuV0qWq1rrF6GFnCYHpY7CHp/8seXyZkF raNNVn+4dOXRAKgN8tibsir7DsnMwCivyUH5mjrGoOjwl9zESIJ4qVq9MzYPau0sR4y1 eXCJakdb7jpdpMvqegYxLgN6/YgmZ2GcKWIKcWn8ePXhT62oAYPTO87Yo4I5RnT6UMuY fhVw== X-Gm-Message-State: APjAAAXPwod/LngY4YXo/IK40bceypEI2Cnkc/SO8Oi2anPiMunsbpWD qYOh5uVXsAW7QUDi7Dswa+31ARs8uup1u4lxHcNgdA== X-Google-Smtp-Source: APXvYqxMPFVEyxGbBLE2wOKpznS4DCJrLOSbyYcUdlsAQ7kAnSpCB73ZBZqH42SjSX4GX/xhtiM2oCUwMg9SbLDNGoQ= X-Received: by 2002:a25:1804:: with SMTP id 4mr17127191yby.278.1564041263735; Thu, 25 Jul 2019 00:54:23 -0700 (PDT) MIME-Version: 1.0 References: <20190725045949.27407-1-somnath.kotur@broadcom.com> <20190725045949.27407-2-somnath.kotur@broadcom.com> In-Reply-To: From: Santoshkumar Karanappa Rastapur Date: Thu, 25 Jul 2019 13:24:12 +0530 Message-ID: To: Somnath Kotur Cc: David Marchand , dev , "Yigit, Ferruh" X-Mailman-Approved-At: Fri, 26 Jul 2019 00:39:22 +0200 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 1/4] net/bnxt: fix extended port counter statistics X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jul 25, 2019 at 1:09 PM Somnath Kotur wrote: > +Santosh > > On Thu, Jul 25, 2019 at 12:52 PM David Marchand > wrote: > >> On Thu, Jul 25, 2019 at 7:05 AM Somnath Kotur >> wrote: >> > >> > From: Santoshkumar Karanappa Rastapur >> > >> > 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 >> > Signed-off-by: Santoshkumar Karanappa Rastapur < >> santosh.rastapur@broadcom.com> >> > Signed-off-by: Somnath Kotur >> > --- >> > 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