更新时间: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
    8
    9
    14:54:08.644116 IP 192.168.1.101.36300 > VM1.targus-getdata1: Flags [.], seq 30552838:30564422, ack 1, win 229, options [nop,nop,TS val 3731068395 ecr 2126531012], length 11584
    14:54:08.644128 IP VM1.targus-getdata1 > 192.168.1.101.36300: Flags [.], ack 30564422, win 2987, options [nop,nop,TS val 2126531013 ecr 3731068395], length 0
    14:54:08.645627 IP 192.168.1.101.36300 > VM1.targus-getdata1: Flags [P.], seq 30564422:30568766, ack 1, win 229, options [nop,nop,TS val 3731068397 ecr 2126531013], length 4344
    14:54:08.645630 IP VM1.targus-getdata1 > 192.168.1.101.36300: Flags [.], ack 30568766, win 2987, options [nop,nop,TS val 2126531015 ecr 3731068397], length 0
    14:54:08.645640 IP 192.168.1.101.36300 > VM1.targus-getdata1: Flags [.], seq 30568766:30583246, ack 1, win 229, options [nop,nop,TS val 3731068397 ecr 2126531013], length 14480
    14:54:08.645650 IP VM1.targus-getdata1 > 192.168.1.101.36300: Flags [.], ack 30583246, win 2987, options [nop,nop,TS val 2126531015 ecr 3731068397], length 0
    [  5]   9.00-10.00  sec  3.42 MBytes  28.7 Mbits/sec
    14:54:08.647306 IP 192.168.1.101.36300 > VM1.targus-getdata1: Flags [.], seq 30583246:30602070, ack 1, win 229, options [nop,nop,TS val 3731068398 ecr 2126531015], length 18824
    14:54:08.648811 IP 192.168.1.101.36300 > VM1.targus-getdata1: Flags [.], seq 30602070:30620894, ack 1, win 229, options [nop,nop,TS val 3731068400 ecr 2126531017], length 18824
    

  6. 打开GRO。

    1
    ethtool -K <dev> gro on
    
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    14:55:41.973148 IP 192.168.1.101.36304 > VM1.targus-getdata1: Flags [.], seq 31263806:31288422, ack 1, win 229, options [nop,nop,TS val 3731161725 ecr 2126624341], length 24616
    14:55:41.973151 IP VM1.targus-getdata1 > 192.168.1.101.36304: Flags [.], ack 31288422, win 5910, options [nop,nop,TS val 2126624342 ecr 3731161725], length 0
    14:55:41.974246 IP 192.168.1.101.36304 > VM1.targus-getdata1: Flags [.], seq 31288422:31314486, ack 1, win 229, options [nop,nop,TS val 3731161726 ecr 2126624342], length 26064
    14:55:41.974249 IP VM1.targus-getdata1 > 192.168.1.101.36304: Flags [.], ack 31314486, win 5904, options [nop,nop,TS val 2126624344 ecr 3731161726], length 0
    14:55:41.975403 IP 192.168.1.101.36304 > VM1.targus-getdata1: Flags [.], seq 31314486:31341998, ack 1, win 229, options [nop,nop,TS val 3731161728 ecr 2126624344], length 27512
    14:55:41.975407 IP VM1.targus-getdata1 > 192.168.1.101.36304: Flags [.], ack 31341998, win 5899, options [nop,nop,TS val 2126624345 ecr 3731161728], length 0
    14:55:41.976639 IP 192.168.1.101.36304 > VM1.targus-getdata1: Flags [.], seq 31341998:31370958, ack 1, win 229, options [nop,nop,TS val 3731161729 ecr 2126624345], length 28960
    14:55:41.976642 IP VM1.targus-getdata1 > 192.168.1.101.36304: Flags [.], ack 31370958, win 5893, options [nop,nop,TS val 2126624346 ecr 3731161729], length 0
    14:55:41.977931 IP 192.168.1.101.36304 > VM1.targus-getdata1: Flags [P.], seq 31370958:31402814, ack 1, win 229, options [nop,nop,TS val 3731161730 ecr 2126624346], length 31856
    14:55:41.977935 IP VM1.targus-getdata1 > 192.168.1.101.36304: Flags [.], ack 31402814, win 5882, options [nop,nop,TS val 2126624347 ecr 3731161730], length 0
    

分享:

    相关文档

    相关产品

close