Skip to main content
Redhat Developers  Logo
  • 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 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

    • OpenShift AI learning
    • 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.
    • Explore the solution
  • 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

    • Access product downloads to start building and testing right away.
    • 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.
    • Explore the benefits

OVS-DPDK Parameters: Dealing with multi-NUMA

June 28, 2017
Kevin Traynor

    In Network Function Virtualization, there is a need to scale functions (VNFs) and infrastructure (NFVi) across multiple NUMA nodes in order to maximize resource usage.

    In this blog, we'll show how to configure Open vSwitch using DPDK datapath (OVS-DPDK) parameters for multiple NUMA systems, based on OVS 2.6/2.7 using DPDK 16.11 LTS.

    OVS-DPDK parameters are set through OVSDB and defaults are provided. Using defaults is a great way to get basic setups running with minimal effort but tuning is often desired and is required to take advantage of multiple NUMA systems.

    Physical NICs or VMs accessed through DPDK interfaces have a NUMA node associated with them. It is important that their NUMA node is known and in the case of VMs set correctly so that OVS-DPDK parameters can be set to correspond.

    For physical NICs, their NUMA node can be found from their PCI address with:

    # lspci -vmms 01:00.0 | grep NUMANode
    NUMANode:	0

     

    For VMs, their NUMA node can be set with libvirt,

    <cputune>
        <vcpupin vcpu='0' cpuset='2'/>
        <vcpupin vcpu='1' cpuset='4'/>
        <vcpupin vcpu='2' cpuset='6'/>
        <emulatorpin cpuset='8'/>
      </cputune>

     

    and identified with numactl:

    # numactl -H
    available: 2 nodes (0-1)
    node 0 cpus: 0 2 4 6 8 10 12 14
    node 1 cpus: 1 3 5 7 9 11 13 15

    dpdk-init

    The dpdk-init is required in order to use DPDK interfaces with OVS-DPDK. In older versions of OVS-DPDK, DPDK was always initialized regardless of whether users wanted DPDK interfaces or not. Now, users can optionally choose to initialize DPDK by setting dpdk-init=true. This needs to be set either before any DPDK interfaces are setup (OVS 2.7) or before OVS-DPDK is started (OVS 2.6). By default, dpdk-init will be interpreted as false.

    To initialize the DPDK

    # ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true

    pmd-cpu-mask

    The pmd-cpu-mask is a core bitmask that sets which cores are used by OVS-DPDK for datapath packet processing.

    If pmd-cpu-mask is set, OVS-DPDK will poll DPDK interfaces with a core of it that is on the same NUMA node as the interface. If there are no cores in pmd-cpu-mask for a particular NUMA node, physical NICs or VMs on that NUMA node cannot be used.

    OVS-DPDK performance typically scales well with additional cores, so it is common that users set pmd-cpu-mask but if it is not set, the default is that the lowest core on each NUMA node will be used for datapath packet processing.

    The pmd-cpu-mask is used directly in OVS-DPDK and it can be set at any time, even while traffic is already flowing.

    As an example on a dual NUMA system where,

    # numactl -H
    available: 2 nodes (0-1)
    node 0 cpus: 0 2 4 6 8 10 12 14
    node 1 cpus: 1 3 5 7 9 11 13 15

     

    to add core 4 and 6 on NUMA 0 and core 5 and 7 on NUMA 1 for datapath packet processing:

    # ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0xF0

    dpdk-socket-mem

    The dpdk-socket-mem sets how hugepage memory is allocated across NUMA nodes. It is important to allocate hugepage memory to all NUMA nodes that will have DPDK interfaces associated with them. If memory is not allocated on a NUMA node associated with a physical NIC or VM, they cannot be used.

    Unfortunately, DPDK initialization has traditionally been unforgiving and trying to allocate hugepage memory to a NUMA node that does not exist results in OVS-DPDK exiting. This issue is now resolved in DPDK so it will disappear once OVS-DPDK is updated to use newer DPDK releases. For now, users should not try to allocate memory to a NUMA node that is not present on the system.

    If dpdk-socket-mem is not set, a default of dpdk-socket-mem=1024,0 will be used, whereby hugepage memory is allocated to NUMA 0 only. If users want to set dpdk-socket-mem it should be set before dpdk-init is set to true (OVS 2.7) or OVS-DPDK is started (OVS 2.6).

    As an example of a dual NUMA system where NUMA 0 and NUMA 1 are allocated 1024 MB each.

    # ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=1024,1024

    Note that 0 MB (no value is also equivalent to 0 MB) can be set for NUMA nodes, which will not be used for OVS-DPDK.

    OVS-DPDK parameters for multi-NUMA
    An example of OVS-DPDK configured for a dual NUMA system.

    dpdk-lcore-mask

    The dpdk-lcore-mask is a core bitmask that is used during DPDK initialization and it is where the non-datapath OVS-DPDK threads such as handler and revalidator threads run. As these are for non-datapath operations, the dpdk-lcore-mask does not have any significant performance impact on multiple NUMA systems. There is a nice default option when dpdk-lcore-mask is not set, in which the OVS-DPDK cpuset will be used for handler and revalidator threads. This means they can be scheduled across multiple cores by the Linux scheduler.

    For DPDK initialization there is a requirement that the NUMA node associated with the least significant bit in the dpdk-lcore-mask (or OVS-DPDK cpuset in the default case) has hugepage memory allocated for it. This can be achieved with the dpdk-socket-mem parameter. If users want to set dpdk-lcore-mask, it should be set before dpdk-init is set to true (OVS 2.7) or OVS-DPDK is started (OVS 2.6).

    As an example of setting dpdk-lcore-mask for DPDK initialization, handler and revalidator threads to run on core 2.

    # ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=0x4

    It is important to remember that pmd-cpu-mask and dpdk-lcore-mask are completely independent. In fact, it is best that there is no overlap in order that the handler or revalidator threads do not interrupt OVS-DPDK datapath packet processing.

    Final Thoughts

    We've seen that OVS-DPDK parameters give users the ability to scale across multiple NUMA nodes supporting increased use of system resources for NFV.


    Download Red Hat Enterprise Linux Developer Suite for development use.
    Last updated: June 23, 2017

    Recent Posts

    • Red Hat Enterprise Linux 10.2 and 9.8: Top features for developers

    • What GPU kernels mean for your distributed inference

    • Debugging image mode with Red Hat OpenShift 4.20: A practical guide

    • EvalHub: Because "looks good to me" isn't a benchmark

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    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

    Chat Support

    Please log in with your Red Hat account to access chat support.