git: 2a346c8993cb - main - vtnet: Prefer "hardware" accounting for the multicast and total number of octets sent
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 04 Sep 2025 20:01:43 UTC
The branch main has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=2a346c8993cbb92a321a7c25bd9ac4dcaae352d1
commit 2a346c8993cbb92a321a7c25bd9ac4dcaae352d1
Author: Joyu Liao <joyul@juniper.net>
AuthorDate: 2025-09-04 20:00:28 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-09-04 20:00:28 +0000
vtnet: Prefer "hardware" accounting for the multicast and total number of octets sent
When ALTQ is enabled, this driver does "hardware" accounting and soft
accounting at the same time. Prefer the "hardware" one to make the logic
simpler.
Reviewed by: zlei
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44817
---
sys/dev/virtio/network/if_vtnet.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index ec4282e0741a..73f27ac147ff 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -3042,13 +3042,9 @@ vtnet_get_counter(if_t ifp, ift_counter cnt)
case IFCOUNTER_OPACKETS:
return (txaccum.vtxs_opackets);
case IFCOUNTER_OBYTES:
- if (!VTNET_ALTQ_ENABLED)
- return (txaccum.vtxs_obytes);
- /* FALLTHROUGH */
+ return (txaccum.vtxs_obytes);
case IFCOUNTER_OMCASTS:
- if (!VTNET_ALTQ_ENABLED)
- return (txaccum.vtxs_omcasts);
- /* FALLTHROUGH */
+ return (txaccum.vtxs_omcasts);
default:
return (if_get_counter_default(ifp, cnt));
}