Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

A statistics update in Open vSwitch user space datapath

September 18, 2023
David Marchand
Related topics:
LinuxOpen source
Related products:
Red Hat Enterprise Linux

    With the demands for higher bandwidth, came the need for scaling and processing packets on more CPU resources. In Open vSwitch (OVS) using DPDK for faster IO, this translated to using more receive and transmit queues to allow more PMD threads to process the packets. This adds some complexity to a system not easy to understand in the first place. Support or operation people still want to know how much traffic is received and how it is distributed across the CPU resources. To offer help, this article describes new statistics added for the user space datapath in OVS 2.17 and later.

    Per queue statistics for DPDK ports

    A first evolution in OVS 2.17 consisted of exposing receive and transmit queues statistics per DPDK physical ports in ovsdb.

    For example:

    # ovs-vsctl get interface dpdk0 statistics | sed -e 's#[{}]##g' -e 's#, #\n#g' | grep packets= | grep -v '=0$'
    rx_packets=5553474
    rx_q0_packets=3705290
    rx_q1_packets=1848184
    tx_broadcast_packets=220
    tx_multicast_packets=488
    tx_packets=39406658924
    tx_q1_packets=3700644
    tx_q2_packets=97
    tx_q3_packets=19696490438
    tx_q4_packets=19706467745

    Those per queue statistics require support from the DPDK driver backing the port.

    A vast majority of physical (and even some virtual) NIC DPDK drivers do support those statistics. But if no statistics appear in ovsdb, you may check for support by looking for the RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS (1 << 6) value in the port dev_flags bitmask through the DPDK telemetry tool (coming with the dpdk-tools rpm).

    For example, check port 0:

    # if [ $(($(echo /ethdev/info,0 | dpdk-telemetry.py -f /var/run/openvswitch/dpdk/rte | jq -r '.["/ethdev/info"]["dev_flags"]') & 64)) != 0 ]; then
      echo per queue stats are supported;
    else
      echo per queue stats may not be implemented for this driver;
    fi
    per queue stats are supported

    Per queue statistics for vhost-user ports

    Getting the same level of information for vhost-user ports has required some reworking in the DPDK vhost-user libary because the library was not accounting such information.


    This was enhanced by the community in the DPDK v22.07 release with this change, and its support was merged in OVS with this change in the 3.1 version:

    # ovs-vsctl get interface vhost0 statistics | sed -e 's#[{}]##g' -e 's#, #\n#g' | grep packets= | grep -v '=0$'
    rx_65_to_127_packets=2987595
    rx_packets=2987595
    rx_q0_good_packets=2987595
    rx_q0_size_65_127_packets=2987595
    tx_65_to_127_packets=14075727
    tx_packets=14075727
    tx_q0_good_packets=14075727
    tx_q0_size_65_127_packets=14075727

    More vhost-user statistics

    As a bonus of the work exposing per queue statistics, the vhost-user library started exposing other internal counters.

    The virtio driver (e.g., the Linux kernel driver by default) plugged on a vhost-user port may require guest notifications for signaling packets delivery. Triggering those notifications impacts the processing cost of such packets, which is why keeping track of the amount of notifications is of interest.

    Previously, OVS was exposing a coverage counter for those notifications, and until OVS 3.0, you could use the following:

    # ovs-appctl coverage/show | grep vhost_notification
    vhost_notification         0.0/sec     0.000/sec        2.0283/sec   total: 7302

    This coverage counter was only hinting at some vhost-user ports used by an unidentified virtual machine.

    Starting OVS 3.1, the coverage counter has been removed in favor of per queue and per port statistics (DPDK change / OVS change):

    # ovs-vsctl get interface vhost0 statistics | sed -e 's#[{}]##g' -e 's#, #\n#g' | grep guest_notifications
    rx_q0_guest_notifications=12
    rx_q1_guest_notifications=1
    tx_q0_guest_notifications=3
    tx_q1_guest_notifications=2

    This nice addition makes it possible to directly point at which virtual machine is slowing down packet processing. Other vhost-user statistics have been added, like exposing the vhost-user IOTLB cache internals. More may be added in the future as members of the community express new requirements.

    A final note about statistics

    As OVS stores per interface statistics in its ovsdb, choices were made to select generic (iow not driver specific) statistics, and that helps in a majority of use cases.

    However, if you do not find the driver-specific statistics you're looking for, it is still possible for debugging to use the DPDK telemetry tool and retrieve all unfiltered port statistics as follows:

    # echo /ethdev/xstats,0 | dpdk-telemetry.py -f /var/run/openvswitch/dpdk/rte
    {
      "/ethdev/xstats": {
        "rx_good_packets": 5553474,
        "tx_good_packets": 39406658860,
        "rx_good_bytes": 710844672,
        "tx_good_bytes": 4886425719104,
        "rx_missed_errors": 78892319,
        "rx_errors": 0,
        "tx_errors": 0,
        "rx_mbuf_allocation_errors": 0,
        "rx_q0_packets": 3705290,
        "rx_q0_bytes": 474277120,
        "rx_q0_errors": 0,
        "rx_q1_packets": 1848184,
        "rx_q1_bytes": 236567552,
        "rx_q1_errors": 0,
        "tx_q0_packets": 0,
        "tx_q0_bytes": 0,
        "tx_q1_packets": 3700615,
        "tx_q1_bytes": 458874621,
        "tx_q2_packets": 71,
        "tx_q2_bytes": 8120,
        "tx_q3_packets": 19696490435,
        "tx_q3_bytes": 2442364825811,
        "tx_q4_packets": 19706467739,
        "tx_q4_bytes": 2443602010552,
        "rx_wqe_errors": 0,
        "rx_unicast_packets": 84445793,
        "rx_unicast_bytes": 10471278332,
        "tx_unicast_packets": 39406658216,
        "tx_unicast_bytes": 4886425618784,
        "rx_multicast_packets": 0,
        "rx_multicast_bytes": 0,
        "tx_multicast_packets": 444,
        "tx_multicast_bytes": 35320,
        "rx_broadcast_packets": 0,
        "rx_broadcast_bytes": 0,
        "tx_broadcast_packets": 200,
        "tx_broadcast_bytes": 65000,
        "tx_phy_packets": 39406658860,
        "rx_phy_packets": 84445793,
        "rx_phy_crc_errors": 0,
        "tx_phy_bytes": 5044052354544,
        "rx_phy_bytes": 10809061504,
        "rx_phy_in_range_len_errors": 0,
        "rx_phy_symbol_errors": 0,
        "rx_phy_discard_packets": 0,
        "tx_phy_discard_packets": 0,
        "tx_phy_errors": 0,
        "rx_out_of_buffer": 78892319,
        "tx_pp_missed_interrupt_errors": 0,
        "tx_pp_rearm_queue_errors": 0,
        "tx_pp_clock_queue_errors": 0,
        "tx_pp_timestamp_past_errors": 0,
        "tx_pp_timestamp_future_errors": 0,
        "tx_pp_jitter": 0,
        "tx_pp_wander": 0,
        "tx_pp_sync_lost": 0
      }
    }

    Related Posts

    • Debugging Memory Issues with Open vSwitch DPDK

    • Non-root Open vSwitch in RHEL

    • Speeding up Open vSwitch with partial hardware offloading

    • The need for speed and the kernel datapath - recent improvements in UDP packets processing

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    What’s up next?

    GitOps has become a standard in deploying applications to Kubernetes, and many companies are adopting the methodology for their DevOps and cloud-native strategy. Download the GitOps Cookbook for useful recipes and examples for successful hands-on applications development and deployment with GitOps.

    Download the GitOps Cookbook
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI