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 AE968A046B for ; Thu, 25 Jul 2019 09:39:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E2881C28E; Thu, 25 Jul 2019 09:39:58 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 428C3DE3 for ; Thu, 25 Jul 2019 09:39:56 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id t132so22575026pgb.9 for ; Thu, 25 Jul 2019 00:39:56 -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=Qnt8MXrhi4FwFA3zWeNYQ90Q7ewn6XyQUsVB6/Fj270=; b=YmQdIlVFmXiywbFrFjWZi96NecEr3CDW+8FKHLAqOJwQzZyFtUimhTSAeFkbkXErST 63FUudVa+pmKKbT7eSyG4hXXk0VzPFlj66ixL2LSyk+g4bHzKt3ZnoMHD14BJqn3zxsv R4LZ0gPUzci9g9WsG52on04okqB+EGOtsgf2I= 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=Qnt8MXrhi4FwFA3zWeNYQ90Q7ewn6XyQUsVB6/Fj270=; b=Eq2doGiHK+3Ib58V37v9rvdOatP/KxZrGM0ehgc3efL8YqBLw2D9h3AFtft57Yeoz7 eLfFI1UhXrcUxtZ2zW//gIOg/W00ayYa+kvCn8HvnbEZp+D9Q9FOEBNhGJ65GtsWcUa3 1qsHK3w3UGiCk4LqkjDo8uDHFGMsGOQgbEoZcsUxMeoCdlftm2k/XKtrkL/vw+AanlJi MyB2YVsNxcZcEt3zF5PiVg11HdFjDAVs0sjOniQrLSYXDXcxDrF8CvF+b1I2/zpMvHN3 OxoiCS7zbUtMVMU8M5G5rgFI0Qy0WMZiKsJfIS1DVRenUdYmKgprbaQcNEyrtu/PDdOo Ke8A== X-Gm-Message-State: APjAAAWL8oiZhlYJyGUIs1vSZdVJX0cfqSCBL4hnLb5NQPQZrz0dX+nw mJn4PtyWSMV6Q1oPAv7ikbQoUAe3GcdRp0m116jvEw== X-Google-Smtp-Source: APXvYqzZPiULtCJRCOEOpI8kMYqSu9cbfBLl6rpjrtW8thc5RY59i6ZOzQgwS3eP41+KT7ELWgp9qEmYswESkI1Rejo= X-Received: by 2002:a62:1b0c:: with SMTP id b12mr15040406pfb.17.1564040395620; Thu, 25 Jul 2019 00:39:55 -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: Somnath Kotur Date: Thu, 25 Jul 2019 13:10:36 +0530 Message-ID: To: David Marchand , Santoshkumar Karanappa Rastapur Cc: dev , "Yigit, Ferruh" 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" +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 >