From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by dpdk.org (Postfix) with ESMTP id F1F25325A for ; Tue, 20 Jun 2017 13:37:51 +0200 (CEST) Received: by mail-pf0-f193.google.com with SMTP id w12so22258497pfk.0 for ; Tue, 20 Jun 2017 04:37:51 -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=oNYPVZB1Tj/ELJ46c65YyCrpgflPHB6FuguxXIrI0fM=; b=CQ+k/MGj3iuT9K6Y+85tUUEp2tdBi/LO7jgFCRFcYomsxKzfFmRfprb2Sovp7DQalM auLJSCsPDgpjnsDp8DbYgcMQg1kFYLnmSIpNv+3GdDDidiSYoHFrY962tAcX/NqdVLqJ k6A4D8YGVNtGkUgdJJcDHGEF1JFDoF2fDql/NtWpKGYQ8OT62yQ6riWAzBQLQgEX6pGh RZf7S97bBrBG4kZZaLSSlGk6eJg0UQtt6+VkFERtQS7aEeHuyNyICG/uJW4Q+Ea7t+Bq 8KQs9fnbIfhkvBqUDNZpvAT7c+myachAI6/hoi/Y0rulhG1rZTO0YUli4Qzj4b4ne2pY fUtw== 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=oNYPVZB1Tj/ELJ46c65YyCrpgflPHB6FuguxXIrI0fM=; b=T3wfVLEN0M9uXpxaY34o7sDz4v0QcMaiCfIUhhZmPLFgHBpFrO6yo3nFKdwFxCV3B/ lWRrd4bVQ2rVOT4CIOTyKvvBX7mN0XAohStWH9fMFnICOcALnk0ogCj1u5YeZo1AVB3B tC2/fj5Pa/lv9dHtinPKo40mJOiYfc1+XzHKYyMbOsZaFkOvCporKHzd7uExLZVvAHqG xUirRGYgCoVTE47+YeZGOm7i9r4MvZAD9p4p6DLznHd2DNr9AR7wp16E3wFb+hi3bXEs 1Vo+sVc6QJOVlmkzgnzD06Fy68S4A1UT3AW0HUb2tfooJ2B4XIZdy3ELQG4qOMDK+quy xUrA== X-Gm-Message-State: AKS2vOxQQIcV25q0l0YMla+luIDQI9KsHs+R/Ec0ZszwaJSYd3PQoA/O 2260bFWkGCZvXe6w X-Received: by 10.99.2.134 with SMTP id 128mr31175017pgc.266.1497958671326; Tue, 20 Jun 2017 04:37:51 -0700 (PDT) Received: from yliu-home.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 25sm6104783pfj.59.2017.06.20.04.37.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:37:50 -0700 (PDT) From: Yuanhan Liu To: Qi Zhang Cc: Beilei Xing , dpdk stable Date: Tue, 20 Jun 2017 19:35:38 +0800 Message-Id: <1497958550-13600-26-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> References: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/i40e: exclude internal packet's byte count' has been queued to stable release 17.05.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: Tue, 20 Jun 2017 11:37:52 -0000 Hi, FYI, your patch has been queued to stable release 17.05.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 06/22/17. So please shout if anyone has objections. Thanks. --yliu --- >>From ec5d186a14f826c0404ad489ecf242fdfbd5420d 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 c18a93b..2d648c2 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2379,6 +2379,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), @@ -2400,7 +2413,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, @@ -2428,7 +2441,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 */ @@ -5196,6 +5209,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 2ff8282..b0d963c 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -639,6 +639,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