我要评分
获取效率
正确性
完整性
易理解

QoS

  1. Configure VFs.

    For details, see Configuring Kernel-Mode SR-IOV.

  2. Start the OVS and configure the network.
    1
    2
    3
    4
    5
    6
    systemctl start openvswitch
    ovs-vsctl add-br br-ovs
    ovs-vsctl add-port br-ovs enp1s0f0_0
    ovs-vsctl add-port br-ovs enp1s0f0
    ip link set dev enp1s0f0 up
    ip link set dev enp1s0f0_0 up
    
  3. Start a VM.
    1
    virsh start vm1
    
  4. Configure QoS rate limiting in the ingress direction.
    1
    ovs-vsctl set Interface enp1s0f0_0 ingress_policing_rate=100000
    
  5. Log in to the VM.
    1
    virsh console vm1
    
  6. Send packets to verify the rate limiting.
    • Run the following command on VM 1 of host 2:
      1
      iperf3 -s
      
    • Run the following command on VM 1 of host 1:
      1
      iperf3 -c <Host2vm1_ip> -t 0
      

    The two VMs send packets to each other, and rate limiting does not work.

    Rate limiting on an ingress port requires that the host OS kernel version be 5.7 or later.

  7. Press Ctrl+] to exit from the VM. Configure QoS rate limiting in the egress direction on a physical machine.
    1
    2
    3
    ovs-vsctl set port enp1s0f0_0 qos=@newqos -- --id=@newqos create qos type=linux-htb other-config:max-rate=200000000 \
    queues=123=@q1 -- --id=@q1 create queue other-config:max-rate=200000000
    ovs-ofctl add-flow br-ovs "in_port=2,actions=set_queue:123,normal"
    
  8. Log in to the VM again and send packets to verify egress rate limiting.

  9. Press Ctrl+] to exit from the VM. View the flow table offloading on any of the physical machines.
    1
    watch -n 1 -d ovs-appctl dpctl/dump-flows 
    

    Flow table offloading:

Verification Result

Rate limiting works in the egress direction but not in the ingress direction. The rate limiting flow table is not offloaded.