Quality of Service

Getting Started with Napatech Link-Virtualization™ Software

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

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.


Page-1 Ellipse OVS DPDK OVS DPDK Sheet.39 Round Corner Rectangle SmartNIC SmartNIC Round Corner Rectangle.24 Round Corner Rectangle.25 Round Corner Rectangle.26 Round Corner Rectangle.27 Round Corner Rectangle.28 Round Corner Rectangle.29 Round Corner Rectangle.30 Round Corner Rectangle.31 L Shape Round Corner Rectangle.33 Round Corner Rectangle.34 L Shape.38 Round Corner Rectangle VM VM Sheet.117 Sheet.118 Sheet.182 Ingress policer Ingress policer Dynamic connector Dynamic connector.197 Rectangle dpdkvp0 dpdkvp0 Sheet.193 Egress policer Egress policer Sheet.200 Egress policer Egress policer Butterfly valve Sheet.210 Butterfly valve.211 Sheet.212 Butterfly valve.213 Sheet.214 Sheet.216 Bridge br0 Bridge br0 Sheet.217 Port 0 Port 0 Rectangle.218 dpdk0 dpdk0

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 \
    --iova-mode=pa --vfio-vf-token=14d63f20-8445-11ea-8900-1f9ce7d5650d \
    -a 0000:02:00.0,representor=[4-5] -a 0000:02:00.4 -a 0000:02:00.5
    "
    
    # 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.0,representor=4"
    
    Set --vfio-vf-token to the uuid which is generated using the uuidgen command. For example:
    uuidgen
    14d63f20-8445-11ea-8900-1f9ce7d5650d
    PCI bus IDs can be obtained using the following command:
     lspci | grep Napatech

    For more information on MAC addresses of the Napatech SmartNIC, see Reading MAC Addresses of the SmartNIC.

  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