From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A733E902 for ; Tue, 28 Jul 2015 17:38:13 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 28 Jul 2015 08:38:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,563,1432623600"; d="scan'208";a="771507269" Received: from sie-lab-212-170.ir.intel.com (HELO silpixa00378251.ir.intel.com) ([10.237.212.170]) by fmsmga002.fm.intel.com with ESMTP; 28 Jul 2015 08:38:12 -0700 From: Maryam Tahhan To: dev@dpdk.org Date: Tue, 28 Jul 2015 16:38:09 +0100 Message-Id: <1438097889-151949-1-git-send-email-maryam.tahhan@intel.com> X-Mailer: git-send-email 2.4.3 Subject: [dpdk-dev] [PATCH v1 1/1] ixgbe: Fix oerrors by setting it to 0 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: Tue, 28 Jul 2015 15:38:14 -0000 Fix afebc86be1346136125af8026dc215f81c202c50. oerrors was txdgpc - hw_stats->gptc, txdgpc is the number of packets DMA'ed by the host and was being reset on every call to read stats so it could be < gptc. Because we currently have no way to add txdgpc to struct hw_stats so that we can maintain a persistent value per port oerrors has now been set to 0. References to txdgpc is now removed as we don't use it. This patch also removes rxnfgpc as it's not used anywhere. Signed-off-by: Maryam Tahhan --- drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 082f361..3687ebf 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2040,7 +2040,6 @@ static void ixgbe_read_stats_registers(struct ixgbe_hw *hw, struct ixgbe_hw_stats *hw_stats, uint64_t *total_missed_rx, uint64_t *total_qbrc, uint64_t *total_qprc, - uint64_t *rxnfgpc, uint64_t *txdgpc, uint64_t *total_qprdc) { uint32_t bprc, lxon, lxoff, total; @@ -2093,8 +2092,6 @@ ixgbe_read_stats_registers(struct ixgbe_hw *hw, struct ixgbe_hw_stats /* Note that gprc counts missed packets */ hw_stats->gprc += IXGBE_READ_REG(hw, IXGBE_GPRC); - *rxnfgpc += IXGBE_READ_REG(hw, IXGBE_RXNFGPC); - *txdgpc += IXGBE_READ_REG(hw, IXGBE_TXDGPC); if (hw->mac.type != ixgbe_mac_82598EB) { hw_stats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCL); @@ -2188,18 +2185,15 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) struct ixgbe_hw_stats *hw_stats = IXGBE_DEV_PRIVATE_TO_STATS(dev->data->dev_private); uint64_t total_missed_rx, total_qbrc, total_qprc, total_qprdc; - uint64_t rxnfgpc, txdgpc; unsigned i; total_missed_rx = 0; total_qbrc = 0; total_qprc = 0; total_qprdc = 0; - rxnfgpc = 0; - txdgpc = 0; ixgbe_read_stats_registers(hw, hw_stats, &total_missed_rx, &total_qbrc, - &total_qprc, &rxnfgpc, &txdgpc, &total_qprdc); + &total_qprc, &total_qprdc); if (stats == NULL) return; @@ -2235,9 +2229,7 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) hw_stats->fclast; /* Tx Errors */ - /*txdgpc: packets that are DMA'ed*/ - /*gptc: packets that are sent*/ - stats->oerrors = txdgpc - hw_stats->gptc; + stats->oerrors = 0; } static void @@ -2262,7 +2254,6 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, struct ixgbe_hw_stats *hw_stats = IXGBE_DEV_PRIVATE_TO_STATS(dev->data->dev_private); uint64_t total_missed_rx, total_qbrc, total_qprc, total_qprdc; - uint64_t rxnfgpc, txdgpc; unsigned i, count = IXGBE_NB_XSTATS; if (n < count) @@ -2272,11 +2263,9 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, total_qbrc = 0; total_qprc = 0; total_qprdc = 0; - rxnfgpc = 0; - txdgpc = 0; ixgbe_read_stats_registers(hw, hw_stats, &total_missed_rx, &total_qbrc, - &total_qprc, &rxnfgpc, &txdgpc, &total_qprdc); + &total_qprc, &total_qprdc); /* If this is a reset xstats is NULL, and we have cleared the * registers by reading them. -- 2.4.3