更新时间:2021-12-25 GMT+08:00
分享

GRO功能验证

  1. 在虚拟机查看GRO和LRO状态。

    1
    2
    ethtool -k <dev> |grep generic-receive-offload
    ethtool -k <dev> |grep large-receive-offload
    

    GRO和LRO状态默认开启。

  2. 接收端关闭GRO、LRO。

    Host2 vm1执行:
    1
    2
    ethtool -K <dev> lro off
    ethtool -K <dev> gro off
    

  3. 接收端收包。

    Host2 vm1执行:
    iperf3 -s &
    tcpdump tcp -i <dev>

  4. 发送端发包。

    Host1 vm1执行:
    1
    iperf3 -c <dst_ip>
    

    接收端查看length为1448:

  5. 接收端打开LRO。

    1
    ethtool -K <dev> lro on
    
    1
    2
    3
    4
    5
    6
    7
    11:52:01.964338 IP 192.168.1.21.40472 > VM1.targus-getdata1: Flags [.], seq 4106154718:4106156166, ack 1, win 229, options [nop,nop,TS val 3504848929 ecr 2864936518], length 1448
    11:52:01.966923 IP 192.168.1.21.40472 > VM1.targus-getdata1: Flags [.], seq 4112365190:4112430350, ack 1, win 229, options [nop,nop,TS val 3504848931 ecr 2864936521], length 65160
    11:52:01.969460 IP 192.168.1.21.40472 > VM1.targus-getdata1: Flags [.], seq 4118834854:4118836302, ack 1, win 229, options [nop,nop,TS val 3504848934 ecr 2864936523], length 1448
    11:52:01.972144 IP 192.168.1.21.40472 > VM1.targus-getdata1: Flags [.], seq 4125595566:4125660726, ack 1, win 229, options [nop,nop,TS val 3504848937 ecr 2864936526], length 65160
    11:52:01.974685 IP 192.168.1.21.40472 > VM1.targus-getdata1: Flags [.], seq 4131612006:4131677166, ack 1, win 229, options [nop,nop,TS val 3504848939 ecr 2864936528], length 65160
    11:52:01.977213 IP 192.168.1.21.40472 > VM1.targus-getdata1: Flags [.], seq 4137750078:4137751526, ack 1, win 229, options [nop,nop,TS val 3504848942 ecr 2864936531], length 1448
    11:52:01.979802 IP 192.168.1.21.40472 > VM1.targus-getdata1: Flags [.], seq 4144198022:4144199470, ack 1, win 229, options [nop,nop,TS val 3504848944 ecr 2864936533], length 1448
    

  6. 打开GRO。

    1
    ethtool -K <dev> gro on
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    11:49:03.845248 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1786770278:1786835438, ack 1, win 229, options [nop,nop,TS val 3504670810 ecr 2864758399], length 65160
    11:49:03.849930 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1800345278:1800410438, ack 1, win 229, options [nop,nop,TS val 3504670815 ecr 2864758404], length 65160
    11:49:03.852684 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1808393262:1808458422, ack 1, win 229, options [nop,nop,TS val 3504670817 ecr 2864758406], length 65160
    11:49:03.855304 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1815960510:1816025670, ack 1, win 229, options [nop,nop,TS val 3504670820 ecr 2864758409], length 65160
    11:49:03.857815 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1823200510:1823265670, ack 1, win 229, options [nop,nop,TS val 3504670823 ecr 2864758411], length 65160
    11:49:03.860765 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1830801062:1830866222, ack 1, win 229, options [nop,nop,TS val 3504670826 ecr 2864758414], length 65160
    11:49:03.863560 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1836160110:1836225270, ack 1, win 229, options [nop,nop,TS val 3504670828 ecr 2864758417], length 65160
    11:49:03.866532 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1840640222:1840705382, ack 1, win 229, options [nop,nop,TS val 3504670831 ecr 2864758420], length 65160
    11:49:03.869366 IP 192.168.1.21.40468 > VM1.targus-getdata1: Flags [.], seq 1844448462:1844489006, ack 1, win 229, options [nop,nop,TS val 3504670834 ecr 2864758423], length 40544
    

分享:

    相关文档

    相关产品

关闭导读