From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) by dpdk.org (Postfix) with ESMTP id 216221B564 for ; Thu, 25 Apr 2019 09:34:34 +0200 (CEST) Received: by mail-vs1-f44.google.com with SMTP id u9so856371vso.7 for ; Thu, 25 Apr 2019 00:34:34 -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=2Q/WzzutQFz0O3moCU8dVHsU/MJmC3FjdBaZKAJpPEk=; b=AluV03nxmto/7VyVDub3L283I33g+pLUiOUINTPlYQScU+97yFFbXlWO5vpR1ENq65 mnEFCph7TAlyNfK6csZngpDpAxwZ74qJxYswQcPMpjFthTsWRn6xk/bLzoM6jF7HTE9f 0uf1UCjjmYpdPd9aRdWa9A+ewFkbfcQPdF/iQuiczG3ejn0ujJPblfil/5vpQC23ctqR 8DvysPh/zSlWuS5BvInDuNWvyUOHFhvBq3BNGL5nQyXDkreMdphQ+5snEURBP4hehRga /t/ONZSjx1xn52wClCX55idox3G8JBRn1VTpwradlUcMJj0FmQWLgb7AJB6uQCkK7mDC qviw== X-Gm-Message-State: APjAAAVFqAQ9DlfG6dOCfpgaX2EKGXv66z02Y5rBuvIkLEC1aLZSDWUf WG6EF0Lk7iWEE8ZkX0/K4XVGEsYwRktfABt/0HIFcg== X-Google-Smtp-Source: APXvYqyzeLbeZHfdgIntt50buLvkk1toavwNwKgkr8MzuT2OY2pKI8X61RLeKqIT6EXe+m4H5ZcJHEaIdTE0xGfsfo0= X-Received: by 2002:a67:fa95:: with SMTP id f21mr19753135vsq.180.1556177673369; Thu, 25 Apr 2019 00:34:33 -0700 (PDT) MIME-Version: 1.0 References: <1556089570-44487-1-git-send-email-simei.su@intel.com> <039ED4275CED7440929022BC67E706115336F811@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E706115336F811@SHSMSX103.ccr.corp.intel.com> From: David Marchand Date: Thu, 25 Apr 2019 09:34:22 +0200 Message-ID: To: "Zhang, Qi Z" Cc: "Su, Simei" , "Lu, Wenzhuo" , "Yang, Qiming" , dev , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [DPDK] net/ice: fix Rx 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: , X-List-Received-Date: Thu, 25 Apr 2019 07:34:34 -0000 On Thu, Apr 25, 2019 at 9:30 AM Zhang, Qi Z wrote: > Hi David: > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand > > Sent: Thursday, April 25, 2019 3:13 PM > > To: Su, Simei > > Cc: qi.zi.zhang@intel.com; Lu, Wenzhuo ; Yang, > > Qiming ; dev ; dpdk stable > > > > Subject: Re: [dpdk-dev] [DPDK] net/ice: fix Rx statistics > > > > On Wed, Apr 24, 2019 at 9:47 AM simei wrote: > > > > > The RX stats will increase even no packets sent, this patch fix this > > > issue by modifying ipackets and ibytes statistics based on vsi instead > > > of port to avoid statistics error. > > > > > > Fixes: a37bde56314d ("net/ice: support statistics") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Simei Su > > > --- > > > drivers/net/ice/ice_ethdev.c | 9 ++++----- > > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/net/ice/ice_ethdev.c > > > b/drivers/net/ice/ice_ethdev.c index 0946b19..1c851ac 100644 > > > --- a/drivers/net/ice/ice_ethdev.c > > > +++ b/drivers/net/ice/ice_ethdev.c > > > @@ -3305,15 +3305,14 @@ static int ice_rx_queue_intr_disable(struct > > > rte_eth_dev *dev, > > > /* call read registers - updates values, now write them to > > > struct */ > > > ice_read_stats_registers(pf, hw); > > > > > > - stats->ipackets = ns->eth.rx_unicast + > > > - ns->eth.rx_multicast + > > > - ns->eth.rx_broadcast - > > > - ns->eth.rx_discards - > > > + stats->ipackets = pf->main_vsi->eth_stats.rx_unicast + > > > + pf->main_vsi->eth_stats.rx_multicast + > > > + pf->main_vsi->eth_stats.rx_broadcast - > > > pf->main_vsi->eth_stats.rx_discards; > > > stats->opackets = ns->eth.tx_unicast + > > > ns->eth.tx_multicast + > > > ns->eth.tx_broadcast; > > > - stats->ibytes = ns->eth.rx_bytes; > > > + stats->ibytes = pf->main_vsi->eth_stats.rx_bytes; > > > stats->obytes = ns->eth.tx_bytes; > > > stats->oerrors = ns->eth.tx_errors + > > > pf->main_vsi->eth_stats.tx_errors; > > > -- > > > 1.8.3.1 > > > > > > > > I don't know this hw nor this code. > > However, from the description and this snippet, it looks like > > opackets/obytes/oerrors are still referring to port stats instead of the > pf stats. > > Can you elaborate ? > > For Rx, packet comes to port then vsi, so we count vsi->rx for how many > valid packet we received. > For Tx, packet comes to vsi then port, so we count port->tx for how many > packet we exactly sent out? > > Does this make sense? > Well, sorry, but no :-) But if you are sure this is the right way, go with it. -- David Marchand From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D2219A05D3 for ; Thu, 25 Apr 2019 09:34:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22DB51B567; Thu, 25 Apr 2019 09:34:35 +0200 (CEST) Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) by dpdk.org (Postfix) with ESMTP id 216221B564 for ; Thu, 25 Apr 2019 09:34:34 +0200 (CEST) Received: by mail-vs1-f44.google.com with SMTP id u9so856371vso.7 for ; Thu, 25 Apr 2019 00:34:34 -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=2Q/WzzutQFz0O3moCU8dVHsU/MJmC3FjdBaZKAJpPEk=; b=AluV03nxmto/7VyVDub3L283I33g+pLUiOUINTPlYQScU+97yFFbXlWO5vpR1ENq65 mnEFCph7TAlyNfK6csZngpDpAxwZ74qJxYswQcPMpjFthTsWRn6xk/bLzoM6jF7HTE9f 0uf1UCjjmYpdPd9aRdWa9A+ewFkbfcQPdF/iQuiczG3ejn0ujJPblfil/5vpQC23ctqR 8DvysPh/zSlWuS5BvInDuNWvyUOHFhvBq3BNGL5nQyXDkreMdphQ+5snEURBP4hehRga /t/ONZSjx1xn52wClCX55idox3G8JBRn1VTpwradlUcMJj0FmQWLgb7AJB6uQCkK7mDC qviw== X-Gm-Message-State: APjAAAVFqAQ9DlfG6dOCfpgaX2EKGXv66z02Y5rBuvIkLEC1aLZSDWUf WG6EF0Lk7iWEE8ZkX0/K4XVGEsYwRktfABt/0HIFcg== X-Google-Smtp-Source: APXvYqyzeLbeZHfdgIntt50buLvkk1toavwNwKgkr8MzuT2OY2pKI8X61RLeKqIT6EXe+m4H5ZcJHEaIdTE0xGfsfo0= X-Received: by 2002:a67:fa95:: with SMTP id f21mr19753135vsq.180.1556177673369; Thu, 25 Apr 2019 00:34:33 -0700 (PDT) MIME-Version: 1.0 References: <1556089570-44487-1-git-send-email-simei.su@intel.com> <039ED4275CED7440929022BC67E706115336F811@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E706115336F811@SHSMSX103.ccr.corp.intel.com> From: David Marchand Date: Thu, 25 Apr 2019 09:34:22 +0200 Message-ID: To: "Zhang, Qi Z" Cc: "Su, Simei" , "Lu, Wenzhuo" , "Yang, Qiming" , dev , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [DPDK] net/ice: fix Rx 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" Message-ID: <20190425073422.FWVJ9eqsIBfUG9R4nsexneA_xo6zauqoMZEO5juL97U@z> On Thu, Apr 25, 2019 at 9:30 AM Zhang, Qi Z wrote: > Hi David: > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand > > Sent: Thursday, April 25, 2019 3:13 PM > > To: Su, Simei > > Cc: qi.zi.zhang@intel.com; Lu, Wenzhuo ; Yang, > > Qiming ; dev ; dpdk stable > > > > Subject: Re: [dpdk-dev] [DPDK] net/ice: fix Rx statistics > > > > On Wed, Apr 24, 2019 at 9:47 AM simei wrote: > > > > > The RX stats will increase even no packets sent, this patch fix this > > > issue by modifying ipackets and ibytes statistics based on vsi instead > > > of port to avoid statistics error. > > > > > > Fixes: a37bde56314d ("net/ice: support statistics") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Simei Su > > > --- > > > drivers/net/ice/ice_ethdev.c | 9 ++++----- > > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/net/ice/ice_ethdev.c > > > b/drivers/net/ice/ice_ethdev.c index 0946b19..1c851ac 100644 > > > --- a/drivers/net/ice/ice_ethdev.c > > > +++ b/drivers/net/ice/ice_ethdev.c > > > @@ -3305,15 +3305,14 @@ static int ice_rx_queue_intr_disable(struct > > > rte_eth_dev *dev, > > > /* call read registers - updates values, now write them to > > > struct */ > > > ice_read_stats_registers(pf, hw); > > > > > > - stats->ipackets = ns->eth.rx_unicast + > > > - ns->eth.rx_multicast + > > > - ns->eth.rx_broadcast - > > > - ns->eth.rx_discards - > > > + stats->ipackets = pf->main_vsi->eth_stats.rx_unicast + > > > + pf->main_vsi->eth_stats.rx_multicast + > > > + pf->main_vsi->eth_stats.rx_broadcast - > > > pf->main_vsi->eth_stats.rx_discards; > > > stats->opackets = ns->eth.tx_unicast + > > > ns->eth.tx_multicast + > > > ns->eth.tx_broadcast; > > > - stats->ibytes = ns->eth.rx_bytes; > > > + stats->ibytes = pf->main_vsi->eth_stats.rx_bytes; > > > stats->obytes = ns->eth.tx_bytes; > > > stats->oerrors = ns->eth.tx_errors + > > > pf->main_vsi->eth_stats.tx_errors; > > > -- > > > 1.8.3.1 > > > > > > > > I don't know this hw nor this code. > > However, from the description and this snippet, it looks like > > opackets/obytes/oerrors are still referring to port stats instead of the > pf stats. > > Can you elaborate ? > > For Rx, packet comes to port then vsi, so we count vsi->rx for how many > valid packet we received. > For Tx, packet comes to vsi then port, so we count port->tx for how many > packet we exactly sent out? > > Does this make sense? > Well, sorry, but no :-) But if you are sure this is the right way, go with it. -- David Marchand