[dpdk-dev,v1] ether: fix overwriting driver-specific stats
Commit Message
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>
---
lib/librte_ether/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
2016-07-19 12:05, Remy Horton:
> 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>
Applied, thanks
@@ -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;
}