TCP performance problems - GSO/TSO, MSS, 8139 related (Ignores lower MTU from PMTUD/MSS)
Host environment
- Operating system: -
- OS/kernel version: any
- Architecture: any
- QEMU flavor: any
- QEMU version:
- QEMU command line:
./qemu-system-x86_64 -M q35 -m 4096 -enable-kvm -hda fedora32.qcow2 -nic user,model=rtl8139
Emulated/Virtualized environment
- Operating system: Linux (others not tested)
- OS/kernel version: Any
- Architecture: Any
Description of problem
MTU handling on guests using an RTL8139 virtualized NIC is broken; net/hw/8139.c works with a static MTU of 1500b for TCP offloading, leading to low throughput when clients connect from sub 1500MTU networks. PMTUD is ignored, and locking to a lower MTU in the OS mitigates the issue.
Steps to reproduce
- Create a guest with an RTL8139 nic
- Try to retrieve a file from a client behind a sub 1500 MTU link
- Observe low bandwidth due to retransmits
Additional information
I just debugged this issue for an NGO which, for whatever reason, had an RTL8139 NIC in their guest. After i finally traced this to the RTL8139, i found this qemu-devel/netdev thread from six years ago, which apparently already debugged this issue and proposed a patch: https://lore.kernel.org/all/20161114162505.GD26664@stefanha-x1.localdomain/
I did not test the patch proposed there, but note that net/hw/8139.c
still looks as discussed in that qemu-devel/netdev thread. As i haven't found a bug report in the archives, i figured you might want to know.