net/netvsc: report correct stats values
PATCH 1/1 net/netvsc: report correct stats values
From: Long Li <[email protected]>
The netvsc should add to the values from the VF and report the sum.
Signed-off-by Long Li <[email protected]>
--- drivers/net/netvsc/hn_ethdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/netvsc/hn_ethdev.c +5 -5
@@ -800,8 +800,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev, stats->oerrors += txq->stats.errors;if (i <RTE_ETHDEV_QUEUE_STAT_CNTRS ) { - stats->q_opackets[i] = txq->stats.packets; - stats->q_obytes[i] = txq->stats.bytes; + stats->q_opackets[i] += txq->stats.packets; + stats->q_obytes[i] += txq->stats.bytes; } }
@@ -817,12 +817,12 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev, stats->imissed += rxq->stats.ring_full;if (i <RTE_ETHDEV_QUEUE_STAT_CNTRS ) { - stats->q_ipackets[i] = rxq->stats.packets; - stats->q_ibytes[i] = rxq->stats.bytes; + stats->q_ipackets[i] += rxq->stats.packets; + stats->q_ibytes[i] += rxq->stats.bytes; } } - stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed; + stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed;return 0 ; }
Signature · 1 line
2.32.0
Quoted 4 lines · On Wed, Mar 23, 2022 at 5:28 AM <[email protected]> wrote:
From: Long Li <[email protected]>
The netvsc should add to the values from the VF and report the sum.
We need a Fixes: tag.
Quoted 2 lines
Signed-off-by Long Li <[email protected]>
Signature · 1 line
David Marchand
Quoted 6 lines · On Tue, 22 Mar 2022 21:28:25 -0700 [email protected] wrote:
From: Long Li <[email protected]>
The netvsc should add to the values from the VF and report the sum.
Signed-off-by Long Li <[email protected]>---