summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRemy Horton <remy.horton@intel.com>2016-07-19 12:05:17 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-22 00:16:45 +0200
commit53ecfa24fbcd17d9855937391ce347f37434fbfa (patch)
tree31e5d0377bf18f2e3b94923a8270097dfc9189f5 /lib
parent6262b92eaab365d52b551fa78adfd871ed59000e (diff)
downloaddpdk-53ecfa24fbcd17d9855937391ce347f37434fbfa.zip
dpdk-53ecfa24fbcd17d9855937391ce347f37434fbfa.tar.gz
dpdk-53ecfa24fbcd17d9855937391ce347f37434fbfa.tar.xz
ethdev: fix overwriting driver-specific stats
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 <remy.horton@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_ether/rte_ethdev.c2
1 files changed, 1 insertions, 1 deletions
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;
}