[PATCH 13/13] nvme: introduce generic per-namespace chardev

Javier Gonz??lez javier.gonz at samsung.com
Mon Apr 12 12:52:46 BST 2021


On 12.04.2021 09:44, Christoph Hellwig wrote:
>On Fri, Apr 09, 2021 at 08:24:01PM +0900, Minwoo Im wrote:
>> I think if we don't have a route to the live controller from the
>> multipath node /dev/ng0n1, how does application figure out controller
>> node to request admin commands like Identify Namespace before their
>> own I/O ?
>>
>> We have sysfs, but it does not provide every information about the
>> namespace.  Or is there any charming way to find out the live
>> controller from a head node through sysfs or something that I missed
>> here ? :)
>
>The devie links points to the subsystem, which then points to the
>controllers:
>
>root at testvm:/sys/class/nvme-generic/ng0n1# ls -l device/
>total 0
>-r--r--r-- 1 root root 4096 Apr 12 07:43 firmware_rev
>-rw-r--r-- 1 root root 4096 Apr 12 07:44 iopolicy
>-r--r--r-- 1 root root 4096 Apr 12 07:43 model
>drwxr-xr-x 3 root root    0 Apr 12 07:43 ng0n1
>drwxr-xr-x 3 root root    0 Apr 12 07:43 ng0n2
>lrwxrwxrwx 1 root root    0 Apr 12 07:44 nvme0 -> ../../nvme-fabrics/ctl/nvme0
>drwxr-xr-x 9 root root    0 Apr 12 07:43 nvme0n1
>drwxr-xr-x 9 root root    0 Apr 12 07:43 nvme0n2
>lrwxrwxrwx 1 root root    0 Apr 12 07:44 nvme1 -> ../../nvme-fabrics/ctl/nvme1
>drwxr-xr-x 2 root root    0 Apr 12 07:44 power
>-r--r--r-- 1 root root 4096 Apr 12 07:43 serial
>-r--r--r-- 1 root root 4096 Apr 12 07:44 subsysnqn
>lrwxrwxrwx 1 root root    0 Apr 12 07:43 subsystem -> ../../../../class/nvme-subsystem
>-rw-r--r-- 1 root root 4096 Apr 12 07:43 uevent
>

It seems like a limitation that we have to transverse sysfs to make an
in-application enumeration to submit namespace-specific admin commands.

Ideally, applications that are already using IOCTLs should be able to
directly work with the char device. If this is not the case, I am afraid
that the applicability will be limited.

I understand that identifying the live controller in multipath is
something that we need to improve. The question is that if this is a
reasonable thing for you. If there is no fundamental limitation here, I
think we can work the details of enabling namespace admin commands
through and merge the same support for the block device and the char
device.

What do you think?



More information about the Linux-nvme mailing list