From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 86695DE3 for ; Tue, 19 Jul 2016 13:05:20 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 19 Jul 2016 04:05:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,389,1464678000"; d="scan'208";a="849101598" Received: from rhorton-mobl.ger.corp.intel.com (HELO VM.ir.intel.com) ([163.33.228.158]) by orsmga003.jf.intel.com with ESMTP; 19 Jul 2016 04:05:18 -0700 From: Remy Horton To: thomas.monjalon@6wind.com Cc: dev@dpdk.org Date: Tue, 19 Jul 2016 12:05:17 +0100 Message-Id: <1468926317-2988-1-git-send-email-remy.horton@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH v1] ether: fix overwriting driver-specific stats 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, 19 Jul 2016 11:05:20 -0000 After doing a driver callout to fill in the driver specific parts of struct rte_eth_stats, rte_eth_stats_get() overwrites the rx_nombuf member regardless of whether the driver itself has assigned a value. Any driver-assigned value should take priority. Fixes: af75078fece3 ("first public release") Signed-off-by: Remy Horton --- lib/librte_ether/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0a6e3f1..f62a9ec 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1490,8 +1490,8 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) memset(stats, 0, sizeof(*stats)); RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP); - (*dev->dev_ops->stats_get)(dev, stats); stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed; + (*dev->dev_ops->stats_get)(dev, stats); return 0; } -- 2.5.5