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 F0834A05D3 for ; Thu, 25 Apr 2019 09:12:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8FE3B1B56B; Thu, 25 Apr 2019 09:12:56 +0200 (CEST) Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by dpdk.org (Postfix) with ESMTP id 83A451B55F for ; Thu, 25 Apr 2019 09:12:55 +0200 (CEST) Received: by mail-vs1-f67.google.com with SMTP id o10so11894897vsp.12 for ; Thu, 25 Apr 2019 00:12:55 -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=p7FTyrena6vD0NXz+Yj4DdRoJkjnp5qyr4Tts65+6dM=; b=fwal1lUWiZHmJn1RzTsUMxA4EsYMwTatfkow/A7wI+u1RWMLyjRJeD+v/rKQX59VNi bKwYqeSoOYaWQUILf+ECq6eKCEEcLRhvJCH9WVCH1/y+pD5iMvSteXjthw2mvRX9azLS P10wDUr/3FzNb3pHAMzhtiRWk/eXKn2uUh4wDFxzf856AtOA00TYgYMDKqOCLwCHOPUG A14KUhaCSrHr/1Aa2ja/CfSxJcQXwfzzO1Ysf6pwRIEpRYnmIMSoVb6KWE8S+ZHqmuOd IroCiktEin0BES0E0LUrFBm//e+I/8jQJ8gDadCbGdJGqny9gBN6GqxGHRnqG4NyVgNr vbuw== X-Gm-Message-State: APjAAAWsXzkoxj6stELMHMdte6W+vshFzFkbhCLVtPc0QqZ+uwuGCqVn vOhLEZXW8oa0V6+yRf3fv7qbT5PkRKsfyyhkYWUeBQ== X-Google-Smtp-Source: APXvYqw0oYkm7/ssfapnkxWT4F+i/MwnPVDOiu+4MGaOW1XXN/geq6J5ApU5tkG+FPCkWiroKP8VtlhCBxZy713b7OY= X-Received: by 2002:a67:dd01:: with SMTP id y1mr2573530vsj.39.1556176374780; Thu, 25 Apr 2019 00:12:54 -0700 (PDT) MIME-Version: 1.0 References: <1556089570-44487-1-git-send-email-simei.su@intel.com> In-Reply-To: <1556089570-44487-1-git-send-email-simei.su@intel.com> From: David Marchand Date: Thu, 25 Apr 2019 09:12:43 +0200 Message-ID: To: simei Cc: qi.zi.zhang@intel.com, Wenzhuo Lu , Qiming Yang , 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: <20190425071243.hyX3CKvlVGyU5qygOAjgqDXiHxA7sXsxXMXEvCM4uQo@z> 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 ? Thanks. -- David Marchand