[PATCH 0/1] nvmet: View subsystem connections on nvmeof target

Redouane BOUFENGHOUR redouane.boufenghour at shadow.tech
Wed Sep 20 07:12:04 PDT 2023


HI,
We need to list the nqn and their IP connected to our target nvmeof server.
In fact we can have several dozen connections on a machine and we need to know
which server is connected to which subsystem.
Currently there is no way to find out which machine is connected to which subsystem
except through the nqn.
The nqn can be modified by the initiator , so for us it’s not necessarily a source
we can trust.
We’ve created a POC to retrieve the nqn and associated ip when a client is connected
to a subsystem.
We’ve tested this poc on a tcp and rdma connection and it’s OK.
For the POC we write to the attr_connected_ctrls file in the subsystems directory for
each subsystem.
We’re not sure this is the right implementation.
Either we create a ctrls directory which will be created on the userland side and
populated with information
from the ctrl connected when the ctrl number folder is created.
Or we use the host directory to add an entry when the machine is connected to write its
 IP address, but this folder is also used by ACLs.
Or we stick to a simple attribute listing all connected controllers nqn and addresses.
That being said, given the reduced size of a configfs page and the large size of some
addresses (ie IPv6 address), that would drastically limit the numbers of controllers
and addresses we could list in this attribute.
what do you think?

Redouane BOUFENGHOUR (1):
  nvmet: View subsystem connections on nvmeof target

 drivers/nvme/target/configfs.c | 30 ++++++++++++++++++++++++++++++
 drivers/nvme/target/core.c     |  7 +++++++
 drivers/nvme/target/nvmet.h    |  2 ++
 drivers/nvme/target/rdma.c     | 10 ++++++++++
 drivers/nvme/target/tcp.c      | 13 +++++++++++++
 5 files changed, 62 insertions(+)

-- 
2.39.2 (Apple Git-143)




More information about the Linux-nvme mailing list