Skip to contentSkip to conversation

nvme-cli: enhance the visibility of multipath using show-topology command

PATCH Superseded Nilay Shroff 1 participant 1 message Sep 4, 2025 NVMe

lore
Share & tools
lore
#0 lore raw

v3 cover nvme-cli: enhance the visibility of multipath using show-topology command

Hi,

There has been recent work to improve the visibility of NVMe multipath configurations. The native NVMe multipath kernel driver supports three I/O path selection policies: numa, round-robin, and queue-depth. However, until now, users have had no insight into which path is selected by the multipath logic for forwarding I/O.

To address this, an RFC was proposed [1] and has since been merged into the Linux kernel as of v6.15. Following that, libnvme was extended to discover multiple paths to a shared NVMe namespace [2]. This patchset builds on those efforts to improve userspace observability of multipath configurations via nvme-cli.

This patchset contains four patches:
The first patch in the series fixes a <device> filter option using which we could be able to filter the output of nvme show-topology command.

The second patch in the series enhances the nvme show-topology command to display multipath configuration, including all discovered paths to a namespace, along with details such as ANA state, NUMA nodes, and queue depth. The show-topology "--ranking" option is extended with a new sub-
option: multipath.

The third patch in the series adds common table APIs for printing nvme cli command output in tabular format. With these APIs, developers no longer need to pre-calculate column or row widths. The output is consistently aligned and easy to read.

The fourth patch adds support for printing show-topology in tabular form leveraging the introduced table APIs to produce well-aligned, easy-to-read output.

As usual, any feedback/sugegstion is most welcome!

Thanks!

Changes from v2:
- For iopolicy=numa, print NUMA nodes and exclude queue-depth. Similarly, for iopolicy=queue-depth, print queue-depth but exclude NUMA nodes. And for iopolicy=round-robin, exclude printing
both NUMA nodes and queue-depth. (Hannes Reinecke, Daniel
Wagner)
Link to v2: https://lore.kernel.org/all/[email protected]/

Changes from v1:
- Added the third patch in the series that implements the common table APIs for printing nvme cli command output in tabular format (Daniel Wagner)
- Added the fourth patch in the series which adds the support for printing show-topology in tabular form (Daniel Wagner)
Link to v1: https://lore.kernel.org/all/[email protected]/

Nilay Shroff (4):
nvme: support <device> option in show-topology command
nvme: extend show-topology command to add support for multipath
nvme: add common APIs for printing tabular format output
nvme: add support for printing show-topology in tabular form

 nvme-print-binary.c |   1 +
 nvme-print-json.c   |  36 ++++-
 nvme-print-stdout.c | 312 +++++++++++++++++++++++++++++++++++++++++-
 nvme-print.c        |   9 +-
 nvme-print.h        |   3 +
 nvme.c              |  29 +++-
 nvme.h              |   2 +
 util/meson.build    |   3 +-
 util/table.c        | 320 ++++++++++++++++++++++++++++++++++++++++++++
 util/table.h        | 149 +++++++++++++++++++++
 10 files changed, 849 insertions(+), 15 deletions(-)
 create mode 100644 util/table.c
 create mode 100644 util/table.h
Signature · 1 line
2.51.0