From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id CEA6F1B489 for ; Fri, 4 Jan 2019 14:27:44 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A5BBC0587F4; Fri, 4 Jan 2019 13:27:44 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-13.ams2.redhat.com [10.36.117.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id B57405C1A1; Fri, 4 Jan 2019 13:27:42 +0000 (UTC) From: Kevin Traynor To: Xiaoyun Li Cc: Qi Zhang , dpdk stable Date: Fri, 4 Jan 2019 13:24:27 +0000 Message-Id: <20190104132455.15170-45-ktraynor@redhat.com> In-Reply-To: <20190104132455.15170-1-ktraynor@redhat.com> References: <20190104132455.15170-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 04 Jan 2019 13:27:44 +0000 (UTC) Subject: [dpdk-stable] patch 'net/i40e: fix statistics inconsistency' has been queued to LTS release 18.11.1 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: , X-List-Received-Date: Fri, 04 Jan 2019 13:27:45 -0000 Hi, FYI, your patch has been queued to LTS release 18.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/11/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >>From 75a79eb359047c0e571c5e9ed248160c885abe3f Mon Sep 17 00:00:00 2001 From: Xiaoyun Li Date: Thu, 6 Dec 2018 14:03:42 +0800 Subject: [PATCH] net/i40e: fix statistics inconsistency [ upstream commit 63056c192005336d7c9d2639efe317639dd3baaa ] While calculating the input packet count per port, discarded packets should be reduced, right now only PF VSI discarded packets are reduced. But while calculating the input byte count per port, Rx byte count is used, which should take all discarded packets into account, including VF VSI ones. This will cause inconsistency in stat counters in some cases. This patch would take all VSI stats as packet and byte count to address the issue. Fixes: 763de290cbd1 ("net/i40e: fix packet count for PF") Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang --- drivers/net/i40e/i40e_ethdev.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 501c30cc3..8dc1a4af8 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3175,4 +3175,5 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_hw_port_stats *ns = &pf->stats; /* new stats */ + struct i40e_vsi *vsi; unsigned i; @@ -3180,13 +3181,12 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) i40e_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 + @@ -3200,4 +3200,19 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) ns->rx_oversize + ns->rx_fragments + ns->rx_jabber; + if (pf->vfs) { + for (i = 0; i < pf->vf_num; i++) { + vsi = pf->vfs[i].vsi; + i40e_update_vsi_stats(vsi); + + stats->ipackets += (vsi->eth_stats.rx_unicast + + vsi->eth_stats.rx_multicast + + vsi->eth_stats.rx_broadcast - + vsi->eth_stats.rx_discards); + stats->ibytes += vsi->eth_stats.rx_bytes; + stats->oerrors += vsi->eth_stats.tx_errors; + stats->imissed += vsi->eth_stats.rx_discards; + } + } + PMD_DRV_LOG(DEBUG, "***************** PF stats start *******************"); PMD_DRV_LOG(DEBUG, "rx_bytes: %"PRIu64"", ns->eth.rx_bytes); -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-01-04 13:23:08.531690458 +0000 +++ 0045-net-i40e-fix-statistics-inconsistency.patch 2019-01-04 13:23:07.000000000 +0000 @@ -1,8 +1,10 @@ -From 63056c192005336d7c9d2639efe317639dd3baaa Mon Sep 17 00:00:00 2001 +From 75a79eb359047c0e571c5e9ed248160c885abe3f Mon Sep 17 00:00:00 2001 From: Xiaoyun Li Date: Thu, 6 Dec 2018 14:03:42 +0800 Subject: [PATCH] net/i40e: fix statistics inconsistency +[ upstream commit 63056c192005336d7c9d2639efe317639dd3baaa ] + While calculating the input packet count per port, discarded packets should be reduced, right now only PF VSI discarded packets are reduced. But while calculating the input byte count per port, Rx byte count is @@ -14,7 +16,6 @@ the issue. Fixes: 763de290cbd1 ("net/i40e: fix packet count for PF") -Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang