Skip to contentSkip to conversation

net/netvsc: add device argument to configure if NUMA information on the device should be used

PATCH Applied [email protected] 2 participants 2 messages Aug 25, 2025 – Aug 27, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net/netvsc: add device argument to configure if NUMA information on the device should be used

From: Long Li <[email protected]>

In most cases, netvsc is used with a VF device. The application generally runs with better performance when all the device memory is allocated on VF's NUMA node, as the VF device carries most of the data packets.

But sometimes netvsc may run on a different NUMA node than that of the VF. This patches adds a device argument "numa_aware" to allow the application to configure if netvsc should be NUMA aware. The default behavior for netvsc is that it is not NUMA aware. Setting "numa_aware=1" tells netvsc to be NUMA aware.

---
Change log
v2: move the code for parsing device arguments to vmbus
v3: change default to be not NUMA aware. Use VMBUS code to parse "numa_aware" only

 doc/guides/nics/netvsc.rst           |  9 ++++
 drivers/bus/vmbus/bus_vmbus_driver.h |  2 +
 drivers/bus/vmbus/linux/vmbus_bus.c  | 66 +++++++++++++++++++++++-----
 drivers/net/netvsc/hn_ethdev.c       |  1 +
 4 files changed, 67 insertions(+), 11 deletions(-)
doc/guides/nics/netvsc.rst +9 -0
index 2c0ea6ac9e..cdeefbe1e1 100644
@@ -141,3 +141,12 @@ The user can specify below argument in devargs.
     A non-zero value tells netvsc to attach external buffers to mbuf on
     receiving packets, thus avoid copying memory. Use of external buffers
     requires the application is able to read data from external mbuf.
+
+#. ``numa_aware``:
+   The numa_aware is used to configure if netvsc driver should be NUMA aware.
+   The default value is 0 (meaning the netvsc driver is not NUMA aware). When
+   used with a VF device, the VF device's NUMA node may not be the same as
+   netvsc's NUMA node. The application generally runs with better performance
+   if all the device queues are allocated on VF's NUMA node, as the VF carries
+   most of the data packets. Setting this value to 1 makes netvsc driver NUMA
+   aware.
drivers/bus/vmbus/bus_vmbus_driver.h +2 -0
index bc394208de..9b8ebe7891 100644
@@ -17,6 +17,8 @@ extern "C" {
 struct vmbus_channel;
 struct vmbus_mon_page;
 
+#define NETVSC_ARG_NUMA_AWARE "numa_aware"
+
 /** Maximum number of VMBUS resources. */
 enum hv_uio_map {
 	HV_TXRX_RING_MAP = 0,
drivers/bus/vmbus/linux/vmbus_bus.c +55 -11

86 lines not on this page · raw message

drivers/net/netvsc/hn_ethdev.c +1 -0
index 0a7ed155d3..cc4099bec4 100644
@@ -204,6 +204,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev)
 		NETVSC_ARG_RXBREAK,
 		NETVSC_ARG_TXBREAK,
 		NETVSC_ARG_RX_EXTMBUF_ENABLE,
+		NETVSC_ARG_NUMA_AWARE,
 		NULL
 	};
 	struct rte_kvargs *kvlist;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · On Mon, 25 Aug 2025 14:50:27 -0700 [email protected] wrote:

From: Long Li <[email protected]>

In most cases, netvsc is used with a VF device. The application generally runs with better performance when all the device memory is allocated on VF's NUMA node, as the VF device carries most of the data packets.

Quoted 7 lines

But sometimes netvsc may run on a different NUMA node than that of the VF. This patches adds a device argument "numa_aware" to allow the application to configure if netvsc should be NUMA aware. The default behavior for netvsc is that it is not NUMA aware. Setting "numa_aware=1" tells netvsc to be NUMA aware.

Queued to next-net. Had to resolve some patch fuzz, and trim the commit subject.