Skip to content

Commit c15ea57

Browse files
kuba-mooSasha Levin
authored andcommitted
virtio-net: fix total qstat values
[ Upstream commit 001160e ] NIPA tests report that the interface statistics reported via qstat are lower than those reported via ip link. Looks like this is because some tests flip the queue count up and down, and we end up with some of the traffic accounted on disabled queues. Add up counters from disabled queues. Fixes: d888f04 ("virtio-net: support queue stat") Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://patch.msgid.link/20250507003221.823267-3-kuba@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6e042b6 commit c15ea57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/virtio_net.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5427,6 +5427,10 @@ static void virtnet_get_base_stats(struct net_device *dev,
54275427

54285428
if (vi->device_stats_cap & VIRTIO_NET_STATS_TYPE_TX_SPEED)
54295429
tx->hw_drop_ratelimits = 0;
5430+
5431+
netdev_stat_queue_sum(dev,
5432+
dev->real_num_rx_queues, vi->max_queue_pairs, rx,
5433+
dev->real_num_tx_queues, vi->max_queue_pairs, tx);
54305434
}
54315435

54325436
static const struct netdev_stat_ops virtnet_stat_ops = {

0 commit comments

Comments
 (0)