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 5DEA4A046B for ; Thu, 25 Jul 2019 09:57:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A97901C29F; Thu, 25 Jul 2019 09:57:24 +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 C78BD1C29D for ; Thu, 25 Jul 2019 09:57:22 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id j26so33136366vsn.10 for ; Thu, 25 Jul 2019 00:57:22 -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=AyQQbSexiokn80On/fVHqBZyEJw8hk0pTZ53ivonSR4=; b=EaAFJ35EA0W9MqNUK30a3Gesq/VWsjUsZbqrpMgB+XSzDwBy8VTEpJZHTvJyuXt0KY vCCBS6BKwJeawydPEnNIHTuTe38j9Te3yrrnRkHiB2hz2IUIcC8Z3LwDy+o0ZaGy+oW/ FWIqfdBCjuReOjMnovjPzCcOHCbbNhhg83iBgOgE2C4zjrAGyn3FNHcWFa9OX5yzA87m BU2pNf1oJhOvmRWhF4XN+CI+oCJT+ZdXUr354kfCo0sxf/KzDko5EpLe1jopz92z4627 22IkFKZro1meqr/s55Wz8X6Ugv70nPacBXhRlNUf2ME9EWYTjC9uSpZqaZrJXAEj+Drr wTgA== X-Gm-Message-State: APjAAAW1ET3hNpXipuof6vyvhbl3YGc4tQHC4mFGtBBTD6m3p5Us+4Y4 d8u1sj1ZEWGgRsy8qjYRaSOO9mPYG9IQ+7JorJw5pA== X-Google-Smtp-Source: APXvYqzwmKKHYG6UCKajyXFyes/RaaQGK3YyT19+1bl0ZjFjHVwbGhWyXXWU3FTIz1NhhytEScsMDpLc+uSKpgXwhxY= X-Received: by 2002:a67:2ec8:: with SMTP id u191mr57821124vsu.39.1564041442226; Thu, 25 Jul 2019 00:57:22 -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: David Marchand Date: Thu, 25 Jul 2019 09:57:11 +0200 Message-ID: To: Santoshkumar Karanappa Rastapur Cc: Somnath Kotur , 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 9:54 AM Santoshkumar Karanappa Rastapur wrote: > > > > 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 >>> > 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. Erf, I must have read your commitlog too quickly, or you could have split it in two patches, anyway understood. -- David Marchand