Bug 259249 - vtnet: Checksum offloading enabled reduces pf NAT performance (~100mbps -> ~200kbps)
Summary: vtnet: Checksum offloading enabled reduces pf NAT performance (~100mbps -> ~2...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords: needs-qa, performance
Depends on:
Blocks:
 
Reported: 2021-10-18 16:33 UTC by emz
Modified: 2021-10-26 23:46 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description emz 2021-10-18 16:33:18 UTC
Router: FreeBSD 13
Network behind NAT: some Linux hosts

Router:
---------------------------------------
[root@balancer1:/etc]# ifconfig | grep -A1 vtnet | grep options        options=4c079b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,TXCSUM_IPV6>        options=4c079b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,TXCSUM_IPV6>


Host behind NAT, several curl launches:
---------------------------------------
[root@back1 server]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 9469M    0  527k    0     0   150k      0 17:55:26  0:00:03 17:55:23  150k^C
[root@back1 server]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 9469M    0  671k    0     0   188k      0 14:15:29  0:00:03 14:15:26  188k^C
[root@back1 server]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 9469M    0 1599k    0     0   198k      0 13:34:49  0:00:08 13:34:41  214k^C
[root@back1 server]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 9469M    0 1647k    0     0   225k      0 11:56:44  0:00:07 11:56:37  218k^C
[root@back1 server]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 9469M    0 1247k    0     0   134k      0 20:05:17  0:00:09 20:05:08  147k^C
[root@back1 server]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 9469M    0  383k    0     0   185k      0 14:31:44  0:00:02 14:31:42  185k^C

Router:
----------------------------------------------
[root@balancer1:/etc]# ifconfig vtnet0 -rxcsum
[root@balancer1:/etc]# ifconfig vtnet1 -rxcsum
[root@balancer1:/etc]# ifconfig vtnet1 -txcsum
[root@balancer1:/etc]# ifconfig vtnet0 -txcsum

Same host behind NAT:
----------------------------------------------
[root@back1 etc]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  3 9469M    3  309M    0     0  89.6M      0  0:01:45  0:00:03  0:01:42 89.6M^C
[root@back1 etc]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 9469M    0 76.9M    0     0  85.2M      0  0:01:51 --:--:--  0:01:51 85.2M^C
[root@back1 etc]# curl --output /dev/null https://mirror.yandex.ru/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  1 9469M    1 99.3M    0     0   123M      0  0:01:16 --:--:--  0:01:16  123M^C

Guess it's self-explanatory.
Comment 1 Aleksandr Fedorov freebsd_committer freebsd_triage 2021-10-21 08:23:31 UTC
Are you sure this is a regression? I do not know of a single version of FreeBSD that works without turning off [rx|tx]csum and LRO.
Comment 2 emz 2021-10-25 15:17:57 UTC
Well... not sure at this moment. May be not a regression, but ...is there a bug for this ?

BTW:
Workaround: it's enough to only turn off the rxcsum [and LRO ?]. With txcsum also turned off the ssh session became unresponsive (though receiving works just fine).