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 BA5EBA05D3 for ; Thu, 25 Apr 2019 09:34:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 681111B56E; Thu, 25 Apr 2019 09:34:37 +0200 (CEST) Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by dpdk.org (Postfix) with ESMTP id 2661D1B567 for ; Thu, 25 Apr 2019 09:34:34 +0200 (CEST) Received: by mail-vs1-f41.google.com with SMTP id g127so11934609vsd.6 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=UdGs22isF8eA+Ryhtd8+562vqPk9flenIWQZyvVKQlYcNvpz56Z2T93PlrgGCyKfXe B2sdOUksR55PqCbPSqVKdAv+gbGTwAOmAbpzriTM4INlC9YWTl20+ICT3Qq115g+2Pmk jGe75aY3sf/F4AVASMsd7/KocgkuttWhN1bUQ3widVb8RPkyNfee7HnTzsaDajBIYwBq LN7VUC+Z8wMxb9XC5OWXjBDJ7xK6wFmyMD+RuJLEnll0P6rnB1aN27k+3muy8HXZCBTm NZSTSjhMJVE5iKT2nS45fgP9RtvtbLVRn8BYssk4wfLuL14kQk1vG8nX6DkP64tuT46I XURg== X-Gm-Message-State: APjAAAVF4z0R5lP7dvagwEXlhcmhenAQyTwT7kjJ6fMeK06jrkh/sfj6 QCH8SOi605K7xxhK5NMPgc6QBnpXlpIMOz7Ah5kXZA== 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-stable] [dpdk-dev] [DPDK] net/ice: fix Rx statistics X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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