root@-x86:~# ethtool -K eno3 gso on
root@-x86:~# ethtool -k eno3|grep generic-
generic-segmentation-offload: on
generic-receive-offload: on
root@-x86:~# ethtool -K eno3 gso off
root@z-x86:~# ethtool -k eno3|grep generic-
generic-segmentation-offload: off
generic-receive-offload: on
root@-x86:~#
root@-x86:~# ethtool -k eno3|grep tcp
tcp-segmentation-offload: on
tx-tcp-segmentation: on
tx-tcp-ecn-segmentation: on
tx-tcp-mangleid-segmentation: on
tx-tcp6-segmentation: on
root@-x86:~# ethtool -K eno3 tso off
root@-x86:~# ethtool -k eno3|grep tcp
tcp-segmentation-offload: off
tx-tcp-segmentation: off
tx-tcp-ecn-segmentation: off
tx-tcp-mangleid-segmentation: off
tx-tcp6-segmentation: off
root@zj-x86:~#
如果开启了 TSO,使用 tcpdump 分析网络流量看到的数据是不一样的,下面给个对比。
-
开启 TSO
root@ -x86:~# ethtool -k eno3 | grep so
tx-gso-robust: off [fixed]
tx-gso-partial: on
root@ -x86:~# ethtool -K eno3 tso off
root@ -x86:~# ethtool -K eno3 gso off
root@ -x86:~# ethtool -k eno3 | grep so
tx-gso-robust: off [fixed]
tx-gso-partial: on
root@ -x86:~# ethtool -K eno3 gso on
root@ -x86:~# ethtool -K eno3 tso on
root@ -x86:~# ethtool -k eno3 | grep so
tx-gso-robust: off [fixed]
tx-gso-partial: on
root@ -x86:~# ethtool -k eno3 | grep so
tx-gso-robust: off [fixed]
tx-gso-partial: on
root@ -x86:~#
root@-x86:~# scp /data/ubuntu-18.04-x86.qcow2 root@10.11.16.81:/data1
root@10.11.16.81's password:
Permission denied, please try again.
root@10.11.16.81's password:
ubuntu-18.04-x86.qcow2
-
关闭 TSO
root@-x86:~# ethtool -k eno4 | grep so tx-gso-robust: off [fixed] tx-gso-partial: on root@-x86:~# ethtool -K eno3 gso off root@-x86:~# ethtool -K eno3 tso off root@-x86:~# ethtool -k eno3 | grep so tx-gso-robust: off [fixed] tx-gso-partial: on root@-x86:~# scp /data/ubuntu-18.04-x86.qcow2 root@10.11.16.81:/data1 root@10.11.16.81's password: ubuntu-18.04-x86.qcow2
关闭tso,开gso
root@-x86:~# ethtool -K eno3 tso off root@-x86:~# ethtool -K eno3 gso on root@-x86:~# scp /data/ubuntu-18.04-x86.qcow2 root@10.11.16.81:/data1 root@10.11.16.81's password: ubuntu-18.04-x86-new.qcow2
开tso,关gso
root@-x86:~# ethtool -K eno3 gso off root@-x86:~# ethtool -K eno3 tso on root@-x86:~# scp /data/ubuntu-18.04-x8.qcow2 root@10.11.16.81:/data1 root@10.11.16.81's password: ubuntu-18.04-x86.qcow2 100% 617MB 79.0MB/s 00:07 root@-x86:~#