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 3C03BA046B for ; Thu, 25 Jul 2019 09:22:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E6C21C293; Thu, 25 Jul 2019 09:22:12 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 61C521C291 for ; Thu, 25 Jul 2019 09:22:10 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id m8so33151483vsj.0 for ; Thu, 25 Jul 2019 00:22:10 -0700 (PDT) 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=F4ohagAqs0vhCXd/H3uQJOifVeZBXIMY9GVjrgs2BI0=; b=ryvxxwObMbfE5svpUsl4G5lnmBIizZnEiaahKzDHbOrxkDTKUoc3+v4v1OTGjZ99oH 3gBxbwhqia/HiXiTtbUERvZOfvKHuaACvbyIw32P1LJGHr7NY7bdqqbOTxUt8ktMEJzP /syGzXsjtcyivaDHpFzCvx/Id1ZQ7JVIr/ROYWLv8S5fxwLKaF9EAa0XlJ99g94CKmtk Q0AeR8S692BDbBQox+bEOim9RqS493eCO1e46kyfzv+bE3RFR2Ji0ncPCGbdtEpOE0sD C4Yk+5lzAoyHB/Ts/pNKXrHHuT0kVOiS2cGjvSrJxatkD9kLyL+HNIw2qn5G+fuENU5h 5M8g== X-Gm-Message-State: APjAAAUDtT+zudlvOLrdVV5njK2GX118Jb1pbLbeCGJ8zC2yYfTt4NX0 YTmA0zwnp31SgihXl1AVTbUv39XF6BXVxcH9Nr+KCQ== X-Google-Smtp-Source: APXvYqxWGtmpGJnU5eM/jD6q1b8PJ7bT/BKN6g499KcXfoBELZY92pW64v0CA03azKifqXZBbcYhhEWUySPjULnE1Lc= X-Received: by 2002:a67:da99:: with SMTP id w25mr19320811vsj.141.1564039329701; Thu, 25 Jul 2019 00:22:09 -0700 (PDT) MIME-Version: 1.0 References: <20190725045949.27407-1-somnath.kotur@broadcom.com> <20190725045949.27407-2-somnath.kotur@broadcom.com> In-Reply-To: <20190725045949.27407-2-somnath.kotur@broadcom.com> From: David Marchand Date: Thu, 25 Jul 2019 09:21:57 +0200 Message-ID: To: Somnath Kotur Cc: dev , "Yigit, Ferruh" Content-Type: text/plain; charset="UTF-8" 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 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 > 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