[PATCH 2/2] nvme: extend show-topology command to add support for multipath

Nilay Shroff nilay at linux.ibm.com
Thu Jul 10 06:46:09 PDT 2025



On 7/9/25 2:58 PM, Daniel Wagner wrote:
> Hi Nilay,
> 
> On Fri, Jul 04, 2025 at 07:19:54PM +0530, Nilay Shroff wrote:
>> $ nvme show-topology -r multipath
>>
>> nvme-subsys2 - NQN=nvmet_subsystem
>>                hostnqn=nqn.2014-08.org.nvmexpress:uuid:12b49f6e-0276-4746-b10c-56815b7e6dc2
>>                iopolicy=numa
>>
>>           _ _ _<head-node>
>>          /              _ _ _ <ana-state>
>>         /              /      _ _ _ <numa-node-list>
>>        /              /      /  _ _ _<queue-depth>
>>       |              /      /  /
>>  +- nvme2n1 (ns 1)  /      /  /
>>  \                 |      |  |
>>   +- nvme2c2n1 optimized 1,2 0 nvme2 tcp traddr=127.0.0.2,trsvcid=4460,src_addr=127.0.0.1 live
>>   +- nvme2c3n1 optimized 3,4 0 nvme3 tcp traddr=127.0.0.3,trsvcid=4460,src_addr=127.0.0.1 live
>>
>> Please note that the headers shown above (e.g., <numa-node-list>,
>> <ana-state>, <hed-node>, and <queue-depth>) are included for clarity
>> only and are not part of the actual output.
> 
> I do like the annotation what the numbers mean. Could you also add those
> annotation to the output?
> 

Yes, I agree that the annotations explaining the numbers are helpful. 
However, if there are multiple subsystems on a host, including such
annotations inline might make the output look cluttered.

Instead, I propose using the following tabular format, which is more 
readable and scalable. We can display this enhanced format only when
the user specifies a --verbose option. Without the --verbose flag, we
can continue using the current tree-style format.

Example verbose output:

$ nvme show-topology --verbose -r multipath

nvme-subsys2 - NQN=nvmet_subsystem
               hostnqn=nqn.2014-08.org.nvmexpress:uuid:12b49f6e-0276-4746-b10c-56815b7e6dc2
               iopolicy=numa
               model=Linux
               serial=d5dc1170f62100d47204
               firmware=6.16.0-r
               type=nvm

<head-node> <namespace>   <path>    <ana-state>  <numa-list>  <queue-depth>   <ctrl>  <state>  <transport>    <address>                  
    |          |             |           |           |            |              |       |          |             |
nvme2n1        1          nvme2c2n1   optimized     1,2           0            nvme2   live        tcp        traddr=127.0.0.2,trsvcid=4460,src_addr=127.0.0.1 
nvme2n1        1          nvme2c3n1   optimized     3,4           0            nvme3   live        tcp        traddr=127.0.0.3,trsvcid=4460,src_addr=127.0.0.1

What do you think?

Thanks,
--Nilay




More information about the Linux-nvme mailing list