RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1525039 - Virtio PMD: Allocate rings memory on same NUMA node the Virtio device is
Summary: Virtio PMD: Allocate rings memory on same NUMA node the Virtio device is
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dpdk
Version: ---
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: pre-dev-freeze
: 8.1
Assignee: Maxime Coquelin
QA Contact: Pei Zhang
URL:
Whiteboard:
Depends On: 1682308 1738635
Blocks: 1679810 1689408 1701002
TreeView+ depends on / blocked
 
Reported: 2017-12-12 14:02 UTC by Maxime Coquelin
Modified: 2021-12-10 15:29 UTC (History)
14 users (show)

Fixed In Version: dpdk-18.11-8.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 20:59:24 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Guest XML example with one Virtio-net device per NUMA node (4.86 KB, text/plain)
2017-12-12 14:02 UTC, Maxime Coquelin
no flags Details
Guest XML. (5.66 KB, text/plain)
2019-09-06 08:52 UTC, Pei Zhang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3394 0 None None None 2019-11-05 20:59:47 UTC

Description Maxime Coquelin 2017-12-12 14:02:45 UTC
Created attachment 1366669 [details]
Guest XML example with one Virtio-net device per NUMA node

Description of problem:

Currently, in DPDK's Virtio PMD driver, the rings memory is allocated with SOCKET_ID_ANY parameter for NUMA affinity.
It turns out the rings memory will always be allocated on the same NUMA node of the CPU running the Virtio PMD probe, which is not always on the same NUMA node than the CPUs doing the device polling.

In case of big guests spanned on multiple hosts NUMA nodes (CPU, memory), the user may want to spread multiple Virtio devices on the different NUMA nodes, so that host and guest CPUs and memory used for one device are on a same NUMA node.

It is possible to set Virtio-pci device NUMA affinity by adding PCI eXpander Bridges (PXB) between the root port and the devices, but DPDK Virtio PMD does not use it to allocate the rings memory.

The goal of this ticket is to have Virtio PMD to allocate rings memory on the same node as the probed device.

Version-Release number of selected component (if applicable):
all DPDK version (up to v17.11)

How reproducible:

Steps to Reproduce:
Create a guest spanned on two host NUMA nodes and two Virtio device using vhost-user backend connected to OVS-DPDK .

The guest also create two NUMA nodes and assign memory and CPUs to it, and assign each Virtio device on a different NUMA node using PXB.

Once guest is booted, bind the two Virtio devices to vfio-pci, and start testpmd using these two devices.

On host side, check on which NUMA node the vhost ports are:
ovs-appctl dpif-netdev/pmd-rxq-show

Actual results:
The two vhost ports are on the same NUMA node

Expected results:
The two vhost ports are on different NUMA nodes

Additional info:

Please find in attachment an example of guest declaring 2 NUMA nodes pinned to 2 host NUMA nodes, with one virtio-net device on each node.

Comment 8 Maxime Coquelin 2018-11-27 10:55:22 UTC
Patch posted upstream: http://patches.dpdk.org/patch/48349/

Comment 10 Maxime Coquelin 2019-03-12 20:16:27 UTC
Backport available.

Branch: private-mcoqueli-bz1525039

Comment 16 Jean-Tsung Hsiao 2019-08-20 19:25:53 UTC
Hi Pei,
This issue is on the VM side. Would you be able to take care of the bug verification?
Thanks!
Jean

Comment 17 Pei Zhang 2019-08-21 05:21:23 UTC
(In reply to Jean-Tsung Hsiao from comment #16)
> Hi Pei,
> This issue is on the VM side. Would you be able to take care of the bug
> verification?
> Thanks!
> Jean

Hi Jean,

OK, I'm taking it and will verify it soon.

Best regards,

Pei

Comment 19 Pei Zhang 2019-09-06 08:50:51 UTC
== Steps:

1. Boot guest with 2 NUMA nodes using 2 pcie-expander-bus, and put 2 vhost-user ports to each of them.

2. In guest, start testpmd.

3. Check vhost-user port numa node.

== Reproduced with dpdk-18.11-3.el8.x86_64: 

After step3, all 2 vhost-user ports are in numa node 1.

# ovs-appctl dpif-netdev/pmd-rxq-show
pmd thread numa_id 1 core_id 21:
  isolated : false
pmd thread numa_id 0 core_id 28:
  isolated : false
  port: dpdk0             queue-id:  0  pmd usage: 10 %
  port: dpdk1             queue-id:  0  pmd usage: 14 %
  port: vhost-user0       queue-id:  0  pmd usage: 12 %
  port: vhost-user0       queue-id:  1  pmd usage:  0 %
  port: vhost-user1       queue-id:  0  pmd usage:  8 %
  port: vhost-user1       queue-id:  1  pmd usage:  0 %


== Verified with dpdk-18.11-8.el8.x86_64:

# ovs-appctl dpif-netdev/pmd-rxq-show
pmd thread numa_id 1 core_id 21:
  isolated : false
  port: vhost-user1       queue-id:  0  pmd usage:  0 %
  port: vhost-user1       queue-id:  1  pmd usage:  0 %
pmd thread numa_id 0 core_id 28:
  isolated : false
  port: dpdk0             queue-id:  0  pmd usage:  8 %
  port: dpdk1             queue-id:  0  pmd usage:  8 %
  port: vhost-user0       queue-id:  0  pmd usage:  0 %
  port: vhost-user0       queue-id:  1  pmd usage:  0 %


So this bug has been fixed very well.

Comment 20 Pei Zhang 2019-09-06 08:52:07 UTC
Created attachment 1612249 [details]
Guest XML.

Comment 21 Pei Zhang 2019-09-06 08:59:19 UTC
Move to 'VERIFIED' as Comment 19 and Comment 20.

More details: We need to reserve hugepage for both NUMA node 0 and NUMA node 1 in guest.

Comment 23 errata-xmlrpc 2019-11-05 20:59:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3394


Note You need to log in before you can comment on or make changes to this bug.