Quality of Service

Getting Started with Napatech Link-Virtualization™ Software

Platform
Napatech SmartNIC
Content Type
Getting Started Guide
Capture Software Version
Link-Virtualization™ Software 4.4

You can setup quality of service (QoS) for the Napatech OVS DPDK offloaded ports.

About this task

Napatech Link-Virtualization™ Software supports rate-limiting quality of service (QoS) for ingress traffic into an Open vSwitch and egress traffic from an Open vSwitch. The following figure illustrates how rate-limiting QoS is applied using an ingress policer and an egress policer.

In this figure, an ingress policer is applied on a virtual port, and egress policers are applied on a virtual port and a physical port. If the rate is higher than the configured value, packets are dropped on these ports limiting the rate as follows:
  • The ingress policer drops traffic that is transmitted from the guest to the vSwitch on the virtual port.
  • The egress policer on the virtual port drops traffic that is transmitted from the vSwitch to the guest on the virtual port.
  • Another egress policer on the physical port drops traffic that is transmitted from the vSwitch to the SmartNIC port on the physical port.

This example describes how to configure QoS.

Procedure

  1. Add a physical port and a virtual port to a bridge.
    # Configure Napatech SmartNIC ports and virtual functions. 
    ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-extra="-n4 \
    --vdev=eth_ntnic0,port=0 --vdev=eth_ntnic1,port=1 -a 0000:02:00.4,\
    representor=[5-6] -a 0000:02:00.5 -a 0000:02:00.6"
    
    # Create a bridge.
    ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
    
    # Add a DPDK physical port to the bridge.
    ovs-vsctl --no-wait add-port br0 dpdk0 -- set int dpdk0 type=dpdk \
    options:"dpdk-devargs=class=eth,mac=00:0D:E9:07:9D:17"
    
    # Add a DPDK virtual port to the bridge
    ovs-vsctl --no-wait add-port br0 dpdkvp0 -- set int dpdkvp0 type=dpdk \
    options:dpdk-devargs="0000:02:00.4,representor=5"
    
    Note: PCI bus IDs can be obtained using the following command:
     lspci | grep Napatech
    Note: The MAC address of the Napatech SmartNIC port can be obtained using the following command:
    /opt/napatech3/bin/ntlog | grep mac
  2. Apply ingress rate limiting on the virtual port.
    # Limit dpdkvp0 to transmit at a maximum of 10000 Kbits/s.
    ovs-vsctl set int dpdkvp0 ingress_policing_rate=10000 \
     ingress_policing_burst=1000
    
    # Verify the configuration
    ovs-vsctl list interface dpdkvp0 |grep ingress
    An output example:
    ingress_policing_burst: 1000
    ingress_policing_rate: 10000
    where:
    • ingress_policing_rate=10000 indicates that the virtual port is allowed to transmit traffic at a maximum of 10 Mb/s.
    • ingress_policing_burst=1000 indicates the maximum amount of frames that the virtual port can transmit beyond the policing rate is 1 Mbits.
    Frames are dropped on this port when they are received at a higher rate than the configured value.
    Note: ingress_policing_rate and ingress_policing_burst are the DPDK QoS parameters. ingress_policing_rate can only be configured on virtual ports, not on physical ports.
    Note: To clear the ingress policing configuration from the port, run:
    ovs-vsctl set interface dpdkvp0 ingress_policing_rate=0
  3. Configure egress rate limiting on a virtual port.
    # Limit dpdkvp0 to transmit at a maximum of 1000000 bytes/s. 
    ovs-vsctl set port dpdkvp0 qos=@newqos -- --id=@newqos create qos \
     type=egress-policer other-config:cir=1000000 other-config:cbs=2048
    
    # Verify the configuration
    ovs-appctl -t ovs-vswitchd qos/show dpdkvp0
    Configure egress rate limiting on a physical port.
    # Limit dpdk0 to transmit at a maximum of 1000000 bytes/s. 
    ovs-vsctl set port dpdk0 qos=@newqos -- --id=@newqos create qos \
     type=egress-policer other-config:cir=1000000 other-config:cbs=2048
    
    # Verify the configuration
    ovs-appctl -t ovs-vswitchd qos/show dpdk0
    An output example:
    QoS: dpdk0 egress-policer
    cbs: 2048
    cir: 1000000
    where:
    • cir=1000000: Committed information rate in bytes of IP packets per second. This indicates dpdk0 is allowed to transmit traffic at a maximum of 1 Mbytes/s.
    • cbs=2048: Committed burst size in bytes. The maximum amount of frames that dpdk0 can transmit beyond the policing rate is 100 Kbytes.
    Frames are dropped on these ports when they are received at a higher rate than the configured value.
    Note: Egress policing can be configured on virtual ports and physical ports.
    Note: To clear the egress policing from the ports, run the following command.
    ovs-vsctl destroy QoS dpdkvp0 -- clear port dpdkvp0 qos
    ovs-vsctl destroy QoS dpdk0 -- clear port dpdk0 qos