From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by dpdk.org (Postfix) with ESMTP id 1E1F72BAA for ; Fri, 14 Jul 2017 12:35:15 +0200 (CEST) Received: by mail-pf0-f196.google.com with SMTP id q85so10553174pfq.2 for ; Fri, 14 Jul 2017 03:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Zc6+ik4CtbdTT34ef1yKtqYng9aG/ezPxDS/kryOIe0=; b=KGi4BcArtgbY8h8WkTzmAEeyOKR1O0QaEPMt8cXaiUdhb0qUy+SXWWFauZn36JEy7j embLq8RcOclDAeSqzoyCzHj9+JBJsUcQYJREyeSp3feRhoXeGmhUKpcSFTm1myFEAc9E dQ/ysL08fNdmxNKMTMCiqowEJ0j/xZlvB/5lppFdYIHJuh3jjI+grAbs+qPNN+K7CrAW 36cn8l/qH5mBxtC+QSXHyM2lelnbsx6OCj2Jm3kCpQic/DYSM0Q6OP/rjjBkuCCo3PIw wWS50IA6dujwg31TYtOa2XYW9aOHw+K78Bnji4PewpDoDEnWwkolho6+v+lnJg5P9EAF XA0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Zc6+ik4CtbdTT34ef1yKtqYng9aG/ezPxDS/kryOIe0=; b=UJrgYY7A47agJXSPX/V3ANULDkgciBQFSdO0PkBMEIliY1fIZJRkrpReynV8vXofXr sYg1RZfCYYhSExiDZ5SZ+7Xz8E12gfE5wyIiKvoQ0O7VWdRu50mIUJ3v3amRx6vFgLhc QFJYYiRCRdtCVrbd8c3vgpk2Z1m2DSv4jEyUc0reOszgGWSs8Y/e1PJvPrhmyB5R/g3z zSd3DdUocjKCebNeGSPpwRTFP9W9XkBgJfx/2G2jfklJ0M8FieGBjxQSg0Lo1sdCBIY2 RFL0NEK0b2egoiMPPqLp+Wf4kH4k3z+w3+CXJxdbAMw7I5N6xKHVFMc7XglEEkbwAjgr Km6Q== X-Gm-Message-State: AIVw113o9AKAwAF2TkvCKQxahBp8HA4aeCKCslaoIYDN83meKbzfcFTR eiR9uPGNsRkfgwp9 X-Received: by 10.84.176.195 with SMTP id v61mr15184694plb.51.1500028514330; Fri, 14 Jul 2017 03:35:14 -0700 (PDT) Received: from localhost.localdomain ([180.158.48.171]) by smtp.gmail.com with ESMTPSA id y205sm15273553pfb.124.2017.07.14.03.35.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Jul 2017 03:35:13 -0700 (PDT) From: Yuanhan Liu To: Qi Zhang Cc: Beilei Xing , dpdk stable Date: Fri, 14 Jul 2017 18:33:33 +0800 Message-Id: <1500028450-25989-9-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500028450-25989-1-git-send-email-yliu@fridaylinux.org> References: <1500028450-25989-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/i40e: exclude internal packet's byte count' has been queued to LTS release 16.11.3 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, 14 Jul 2017 10:35:15 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/19/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 0e8a05b462ae056bb3a198c0cc866132bdfe0bde Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Thu, 1 Jun 2017 13:55:45 -0400 Subject: [PATCH] net/i40e: exclude internal packet's byte count [ upstream commit 0bcdc44510ef5efd7c0069cdd0161e6f446c254b ] Tx/Rx byte counts of internal managed packet should be excluded from the total rx/tx bytes. Fixes: 9aace75fc82e ("i40e: fix statistics") Signed-off-by: Qi Zhang Acked-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 21 +++++++++++++++++++-- drivers/net/i40e/i40e_ethdev.h | 5 +++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4e4cd16..975f27a 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2146,6 +2146,19 @@ i40e_read_stats_registers(struct i40e_pf *pf, struct i40e_hw *hw) struct i40e_hw_port_stats *ns = &pf->stats; /* new stats */ struct i40e_hw_port_stats *os = &pf->stats_offset; /* old stats */ + /* Get rx/tx bytes of internal transfer packets */ + i40e_stat_update_48(hw, I40E_GLV_GORCH(hw->port), + I40E_GLV_GORCL(hw->port), + pf->offset_loaded, + &pf->internal_rx_bytes_offset, + &pf->internal_rx_bytes); + + i40e_stat_update_48(hw, I40E_GLV_GOTCH(hw->port), + I40E_GLV_GOTCL(hw->port), + pf->offset_loaded, + &pf->internal_tx_bytes_offset, + &pf->internal_tx_bytes); + /* Get statistics of struct i40e_eth_stats */ i40e_stat_update_48(hw, I40E_GLPRT_GORCH(hw->port), I40E_GLPRT_GORCL(hw->port), @@ -2167,7 +2180,7 @@ i40e_read_stats_registers(struct i40e_pf *pf, struct i40e_hw *hw) * so subtract ETHER_CRC_LEN from the byte counter for each rx packet. */ ns->eth.rx_bytes -= (ns->eth.rx_unicast + ns->eth.rx_multicast + - ns->eth.rx_broadcast) * ETHER_CRC_LEN; + ns->eth.rx_broadcast) * ETHER_CRC_LEN + pf->internal_rx_bytes; i40e_stat_update_32(hw, I40E_GLPRT_RDPC(hw->port), pf->offset_loaded, &os->eth.rx_discards, @@ -2195,7 +2208,7 @@ i40e_read_stats_registers(struct i40e_pf *pf, struct i40e_hw *hw) pf->offset_loaded, &os->eth.tx_broadcast, &ns->eth.tx_broadcast); ns->eth.tx_bytes -= (ns->eth.tx_unicast + ns->eth.tx_multicast + - ns->eth.tx_broadcast) * ETHER_CRC_LEN; + ns->eth.tx_broadcast) * ETHER_CRC_LEN + pf->internal_tx_bytes; /* GLPRT_TEPC not supported */ /* additional port specific stats */ @@ -4920,6 +4933,10 @@ i40e_pf_setup(struct i40e_pf *pf) pf->offset_loaded = FALSE; memset(&pf->stats, 0, sizeof(struct i40e_hw_port_stats)); memset(&pf->stats_offset, 0, sizeof(struct i40e_hw_port_stats)); + pf->internal_rx_bytes = 0; + pf->internal_tx_bytes = 0; + pf->internal_rx_bytes_offset = 0; + pf->internal_tx_bytes_offset = 0; ret = i40e_pf_get_switch_config(pf); if (ret != I40E_SUCCESS) { diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 5f3ecd9..f283319 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -431,6 +431,11 @@ struct i40e_pf { struct i40e_hw_port_stats stats_offset; struct i40e_hw_port_stats stats; + /* internal packet byte count, it should be excluded from the total */ + uint64_t internal_rx_bytes; + uint64_t internal_tx_bytes; + uint64_t internal_rx_bytes_offset; + uint64_t internal_tx_bytes_offset; bool offset_loaded; struct rte_eth_dev_data *dev_data; /* Pointer to the device data */ -- 2.7.4