Repository navigation
Ignore unknown link speed in homa_qdev_update_sysctl - #145
randomizedcoder wants to merge 1 commit into
Conversation
Drivers that don't know the link speed, such as virtio_net, report SPEED_UNKNOWN (-1) from get_link_ksettings. homa_qdev_update_sysctl used it as is, giving link_mbps -1 and a negative max_nic_queue_bytes, so every deferrable packet was deferred and the pacer never sent it: with the homa qdisc on a virtio NIC, large Homa messages and TCP stalled. A speed of 0 would divide by zero. Fall back to homa->link_mbps in both cases. Found by running two VMs with the homa qdisc on their virtio NICs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi Dave, I am also using virtio, thank for your this great work. May I ask are you using gso_force_software or set maximal gso size to MTU. virtio by default doesn’t sent chunk the skb on the “wire”, so receiver will just receive a big skb - which Homa AFAIK unable to process. Maybe I am wrong as I am always using gso_force_software. Problem is gso_force_software will perform GSO on the skb, the segment function is not optimized for Homa. We can either fix it properly let Homa able to handle a raw skb before actual GSO, or improve the performance of the segment. Cheers, |
|
Hi Tianyi, Thanks! Neither: we run Homa's defaults, so Our two VMs are also linked by a QEMU So we haven't tested the case you describe (tap/vhost with host TSO, where the receiver gets one big skb). That seems separate from this PR, which only stops the qdisc from using Some background on where these PRs come from: we've built a testing harness in Nix that builds Homa against a range of kernels and boots it in QEMU microVMs, including a two-VM pair test (traffic, netem loss and delay, Homa's qdisc and pacer, rmmod) on regular, KASAN/lockdep/UBSAN and KCSAN kernels. It also runs the unit tests with coverage, static analysis, netdev's checks on the
We're hoping to submit the Nix harness as its own PR soon, for discussion and review. Cheers, |
|
Hi Dave, Thank you, I see your use case. but overall I think we should leverage TSO and also the feature that virtio doesn’t chunk gso skb, for better performance.
Cheers, |
SPEED_UNKNOWN(-1) fromget_link_ksettings;homa_qdev_update_sysctlused it, givinglink_mbps-1 and a negativemax_nic_queue_bytes.pacer_homa_packets0).cycles_per_mibytecalculation.homa->link_mbpsfor 0 andSPEED_UNKNOWN.homa_qdev_update_sysctl__link_speed_unknown(red: link_mbps -1, cycles_per_mibyte 1953; green: 885/885).🤖 Generated with Claude Code