net/netvsc: add device argument to configure if NUMA information on the device should be used
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
@@ -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
@@ -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
@@ -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
Stephen Hemminger
AppliedQuoted 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.Signed-off-by Long Li <[email protected]>
Queued to next-net. Had to resolve some patch fuzz, and trim the commit subject.