nvme-tcp: NIC topology aware I/O queue scaling and queue info export
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 3/34 patches 8 repliesIn review
- v2 posting 2/34 patches 4 repliesSuperseded
- v2 posting 1/30 of 4 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 4 patches | 12 replies | Superseded |
Changes in v2 from the cover letter
- remove the "match-hw-queues" fabric option; always limit the number of NVMe/TCP I/O queues to min(num_online_cpus, num_nic_queues)
- drop the diagnostic patch reporting NIC queue underutilization
- split the netdev helper into a separate patch
- move the netdev helper implementation to net/core/dev.c
Patches in v2 posting 3/3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | net: add helper for device lookup by destination addressinclude/ net/ | +89 | 0 replies | |
| 2/4 | nvme-tcp: limit I/O queue count based on NIC queue countdrivers/ | +61 | 4 replies | |
| 3/4 | nvme: add debugfs helpers for NVMe driversdrivers/ drivers/ drivers/ | +140 | 2 replies | |
| 4/4 | nvme: expose queue information via debugfsdrivers/ drivers/ drivers/ +1 more | +122 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RESEND PATCH v2 0/4] nvme-tcp: NIC topology aware I/O queue scaling and queue info export
Hi,
This is a resend of the previous series to include the networking maintainers and mailing list. There are no code or commit message changes since the previous posting.
This series has been updated based on the feedback received during LSFMM. The changelog is updated accordingly.
The NVMe/TCP host driver currently provisions I/O queues primarily based on CPU availability rather than the capabilities and topology of the underlying network interface.
On modern systems with many CPUs but fewer NIC hardware queues, this can lead to multiple NVMe/TCP I/O workers contending for the same TX/RX queue, resulting in increased lock contention, cacheline bouncing, and degraded throughput.
This RFC proposes a set of changes to better align NVMe/TCP I/O queues with NIC queue resources, and to expose queue/flow information to enable more effective system-level tuning.
Key ideas
---------
1. Scale NVMe/TCP I/O queues based on NIC queue count
Instead of relying solely on CPU count, limit the number of I/O workers to:
min(num_online_cpus, netdev->real_num_{tx,rx}_queues)2. Improve CPU locality
Align NVMe/TCP I/O workers with CPUs associated with NIC IRQ affinity to reduce cross-CPU traffic and improve cache locality.
3. Expose queue and flow information via debugfs
Export per-I/O queue information including:
- queue id (qid)
- CPU affinity
- TCP flow (src/dst IP and ports)
This enables userspace tools to configure:
- IRQ affinity
- RPS/XPS
- ntuple steering
- or any other scaling as deemed feasible
4. Provide infrastructure for extensible debugfs support in NVMe
Together, these changes allow better alignment of:
flow -> NIC queue -> IRQ -> CPU -> NVMe/TCP I/O worker
Performance Evaluation
----------------------
Tests were conducted using fio over NVMe/TCP with the following parameters:
ioengine=io_uring
direct=1
bs=4k
numjobs=<#nic-queues>
iodepth=64
System:
CPUs: 72
NIC: 100G mlx5Two configurations were evaluated.
Scenario 1: NIC queues < CPU count
----------------------------------
- CPUs: 72
- NIC queues: 32
Baseline Patched Patched + tuning
randread 3141 MB/s 3228 MB/s 7509 MB/s
(767k IOPS) (788k IOPS) (1833k IOPS)randwrite 4510 MB/s 6172 MB/s 7518 MB/s
(1101k IOPS) (1507k IOPS) (1836k IOPS)randrw (read) 2156 MB/s 2560 MB/s 3932 MB/s
(526k IOPS) (625k IOPS) (960k IOPS)randrw (write) 2155 MB/s 2560 MB/s 3932 MB/s
(526k IOPS) (625k IOPS) (960k IOPS)Observation:
When CPU count exceeds NIC queue count, the baseline configuration suffers from queue contention. The proposed changes provide modest improvements on their own, and when combined with queue-aware tuning (IRQ affinity, ntuple steering, and CPU alignment), enable up to ~1.5x–2.5x throughput improvement.
Scenario 2: NIC queues == CPU count
-----------------------------------
- CPUs: 72
- NIC queues: 72
Baseline Patched + tuning
randread 4310 MB/s 7987 MB/s
(1052k IOPS) (1950k IOPS)randwrite 7947 MB/s 7972 MB/s
(1940k IOPS) (1946k IOPS)
randrw (read) 3583 MB/s 4030 MB/s
(875k IOPS) (984k IOPS)
randrw (write) 3583 MB/s 4029 MB/s
(875k IOPS) (984k IOPS)
Observation:
When NIC queues are already aligned with CPU count, the baseline performs well. The proposed changes maintain write performance (no regression) and still improve read and mixed workloads due to better flow-to-CPU locality.
Notes on tuning
---------------
The "patched + tuning" configuration includes:
- aligning NVMe/TCP I/O workers with NIC queue count
- IRQ affinity configuration per RX queue
- ntuple-based flow steering
- CPU/queue affinity alignment
These tuning steps are enabled by the queue/flow information exposed through this patchset.
As usual, feedback/comment/suggestions are most welcome!
Changes from v1:
- remove the "match-hw-queues" fabric option; always limit the number of NVMe/TCP I/O queues to min(num_online_cpus, num_nic_queues)
- drop the diagnostic patch reporting NIC queue underutilization
- split the netdev helper into a separate patch
- move the netdev helper implementation to net/core/dev.c
Link to v1: https://lore.kernel.org/all/[email protected]/
Nilay Shroff (4):
net: add helper for device lookup by destination address
nvme-tcp: limit I/O queue count based on NIC queue count
nvme: add debugfs helpers for NVMe drivers
nvme: expose queue information via debugfs
drivers/nvme/host/Makefile | 2 +- drivers/nvme/host/core.c | 3 + drivers/nvme/host/debugfs.c | 191 ++++++++++++++++++++++++++++++++++++ drivers/nvme/host/nvme.h | 12 +++ drivers/nvme/host/tcp.c | 115 ++++++++++++++++++++++ include/linux/netdevice.h | 5 + net/core/dev.c | 84 ++++++++++++++++ 7 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 drivers/nvme/host/debugfs.c
Signature · 1 line
2.53.0