Rate This Document
Findability
Accuracy
Completeness
Readability

OVS Queue Selection Optimization

When a VM is configured with multiple queues, the CPU running the qperf tool may be different from the CPU handling virtio-net input interrupts. In this case, the VM may exit due to inter-processor interrupts (IPIs), increasing latency overhead. In latency-sensitive scenarios, the packet sending queue selection logic on the OVS can be modified to add a sending mode. When the PMD receives a network packet from the VM, it records the 5-tuple information and queue ID. When it sends packets to the VM later, it matches the queue ID based on the 5-tuple information. In this way, VM exits caused by IPIs and packet transmission latency can be reduced.

  1. Download DPDK 24.11 source code.
    1
    git clone https://github.com/DPDK/dpdk.git -b v24.11
    

    Download the OVS 3.5 source code to the upper-level directory of the DPDK 24.11 source code directory.

    1
    git clone https://github.com/openvswitch/ovs.git -b v3.5.0
    
  2. Download the patch for optimizing the OVS queue selection to the upper-level directory of the DPDK 24.11 source code directory.
    1
    git clone https://gitee.com/kunpeng_compute/boostkit_-virtualization.git
    
  3. Apply the patch to the OVS source code. Run the following command in the root directory of the OVS source code:
    1
    git am --reject ../boostkit_-virtualization/dpdk/dpdk-24.11/\[Virtualization_Loss_Optimization\]0001-Adding-a-new-transmission-mode-TXQ_REQ.patch
    
  4. Compile the DPDK. Run the following commands in the root directory of the DPDK source code:
    1
    2
    3
    4
    meson --prefix=/usr --libdir=/usr/lib64 --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include/dpdk build 
    ninja -C build
    ninja -C build install
    ldconfig
    

    Compile OVS. Run the following commands in the root directory of the OVS source code:

    1
    2
    3
    4
    ./boot.sh
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/lib64 --enable-ssl --enable-shared --with-dpdk=shared
    make -j`nproc`
    make -j`nproc` install
    
  5. Enable OVS queue selection optimization.
    1
    ovs-vsctl set Interface tap0 other_config:tx-steering=txfollowrx
    

    To disable this optimization, run the following command:

    1
    ovs-vsctl remove Interface tap0 other_config tx-steering