Fix the aggregation of the interface level counters dev.vtnet.X.tx_task_rescheduled, dev.vtnet.X.tx_tso_offloaded, dev.vtnet.X.tx_csum_offloaded, dev.vtnet.X.rx_task_rescheduled, dev.vtnet.X.rx_csum_offloaded, and dev.vtnet.X.rx_csum_failed. Also ensure that dev.vtnet.X.tx_defrag_failed only counts the number of times m_defrag() fails.
While there, mark sysctl-variables used for exporting statistics as such (CTLFLAG_STATS).
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
I tested this patch with D51686 applied by looking at the csum counters per queue and the general rx_csum_offloaded counter with sysctl dev.vtnet. With nc, I sent TCP packets from a Linux host to a FreeBSD VM that uses virtio with multiple queues.
Without this patch, only csum queue counters increase. The rx_csum_offloaded counter remains 0. With this patch, the rx_csum_offloaded counter is the sum of all csum queue counters as it should be.
I recommend to remove the statistic variables of accumulated values, such as rx_csum_offloaded. The functions like vtnet_sysctl_rx_csum_offloaded can calculate the value with a local variable instead. But it is probably better to do that in another review.
I agree. That is something for a cleanup patch, which does not change the functionality.