From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f68.google.com (mail-it0-f68.google.com [209.85.214.68]) by dpdk.org (Postfix) with ESMTP id D4ABE37B0 for ; Fri, 29 Jul 2016 19:16:55 +0200 (CEST) Received: by mail-it0-f68.google.com with SMTP id j124so7501177ith.3 for ; Fri, 29 Jul 2016 10:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=plN6EKU158V+OzwSrg6OTjgcPIR81kZES2TmSIb98YY=; b=KJUF1QmSmx6bS9Vzaqo79MSZFasGqU95Ofa4tAQIOmwXE2YCYv9Zzr0q3vJwukeyyS aCjXTKyYihLkTDddzX46C0N+F9yQiZ5c/CQb7XDpVXUmskb9Qdixqzl8YLklb0/WxCoX yTg959k6syVPGdUoRN8tFqfZpgpCqp6WJJBEGQtO8dg3Blg8wNa5v4Wrgx/1tPi61vup dehhG/8zeWKyGcAPr5JL9UvZzdItm93YKJYObg7G2iI62tJSKXQyPA+qO+9GxwrFzbEO HMglxdr94Gc5YiY179L64MgisHA86sqXWP4WXaL4dHPhirHqWEVl0cyql3sW9Of/u+W/ YPvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=plN6EKU158V+OzwSrg6OTjgcPIR81kZES2TmSIb98YY=; b=Ouh6mI7sbXPSrppYlAXMxDr/FnUjfpTWwboz5Gh5QDt8EmXB86VSgUDYq91QrIjnJW tXsqsegndKfptb6wfPRNtzQNrmWkjq53ES6aZJ3BKOAE9uEus6XhR3Ncu9wc4gbHHBFx 8X5/9FJTxFo100he60yJXV69ETrS9y3dsBXfxUf8cHlj/qjnL6hcrAFllD7XiWSUhmA8 fQzyk6BxkhlFluZvgm6ZF/4TADcFikzFOMMBK8YSYVQuGJAeC1Gs046kh/NCqhvdwsCq XGO6BlorEXiWdtEDzD62/pjRYq9XjoeW4P85AoyaqYAEB/VeCLxw7l4JFlW7cYFATgp+ ghVw== X-Gm-Message-State: AEkoouuwzdj9iiQvY5tgZPolkTjsNeyp0AbDm4nfd38v/UXO6vKYxODuju0ZrRYZwZ+ZK4dLnN4T17mpsUryZA== X-Received: by 10.36.149.193 with SMTP id m184mr2492898itd.94.1469812614207; Fri, 29 Jul 2016 10:16:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.10.103 with HTTP; Fri, 29 Jul 2016 10:16:53 -0700 (PDT) In-Reply-To: <1469782239-48758-1-git-send-email-wei.zhao1@intel.com> References: <1469782239-48758-1-git-send-email-wei.zhao1@intel.com> From: Kyle Larose Date: Fri, 29 Jul 2016 13:16:53 -0400 Message-ID: To: Wei Zhao1 Cc: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix Rx statistic inconsistent X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2016 17:16:56 -0000 On Fri, Jul 29, 2016 at 4:50 AM, Wei Zhao1 wrote: > rx_good_bytes and rx_good_packets statistic is inconsistent when port > stopped,ipackets statistic is minus the discard packets but rx_bytes > statistic not.Also,i40e has no statistic of discard bytes, so we have to > delete discard packets item from rx_good_packets statistic. > > Fixes: 9aace75fc82e ("i40e: fix statistics") > > Signed-off-by: Wei Zhao1 > --- > drivers/net/i40e/i40e_ethdev.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c > index 11a5804..553dfd9 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -2319,8 +2319,7 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > > 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; > + pf->main_vsi->eth_stats.rx_broadcast; > stats->opackets = pf->main_vsi->eth_stats.tx_unicast + > pf->main_vsi->eth_stats.tx_multicast + > pf->main_vsi->eth_stats.tx_broadcast; > -- > 2.5.5 > Is it not worse to report a received packet when no packet was actually received by the upper layers under normal operations than to ensure that packets and bytes are consistent when an interface is stopped? It seems like the first case is much more likely to occur than the second. Are we just introducing a new issue to fix another? How does this behaviour compare to other NICs? Does the ixgbe report discarded packets in its ipackets? My reading of the driver is that it does not. In fact, it does something interesting to deal with the problem: from: http://dpdk.org/browse/dpdk/tree/drivers/net/ixgbe/ixgbe_ethdev.c /* * An errata states that gprc actually counts good + missed packets: * Workaround to set gprc to summated queue packet receives */ hw_stats->gprc = *total_qprc; total_gprc is equal to the sum of the qprc per queue. Can we do something similar on the i40e instead of adding unicast, mulitcast and broadcast?