[RFC PATCH 0/3] nvmetcli: remote configuation

Hannes Reinecke hare at suse.de
Fri Feb 12 10:52:26 EST 2021


Hi all,

I've discovered that SPDK has an JSON RPC interface which allows for
remote configuration. And it turns out that the SPDK configuration
itself is pretty similar to the in-kernel NVMe-oF target (surprise,
surprise).
And to not let SPDK have an upper edge here's a simple JSON-RPC proxy
for nvmet, together with a JSON-RPC client 'nvmetadm'.
This allows a full remote configuration of an NVMe-oF target:

# nvmetadm nvmf_create_subsystem --nqn=nqn.nvmf-test1
# nvmetadm nvmf_subsystem_add_port --nqn=nqn.nvmf-test1 \
  --traddr=<target-ip> --trtrype=tcp --adrfam=ipv6
# nvmetadm bdev_create_file --file-name=Testfile1 --size=1G
# nvmetadm nvmf_subsystem_add_ns --nqn=nqn.nvmf-test1 \
  --bdev=Testfile1
# nvmetadm nvmf_subsystem_add_host --nqn=nqn.nvmf-test1 \
  --host=<hostnqn>
# nvme discover --transport=tcp --traddr=<target-ip> \
  --trsvcid=4420

With this it should be possible to convert blktests nvme suite to use
this interface, which will allow blktest to run across arbitrary
transports instead of just nvme-loop.

As usual, comments and reviews are welcome.

Hannes Reinecke (3):
  nvmetcli: add 'merge' parameter to set_config()
  nvmetproxy: add a JSON-RPC proxy daemon
  nvmetadm: add JSON-RPC client for remote configuration

 Documentation/Makefile       |  24 +-
 Documentation/nvmetproxy.txt | 111 ++++++++
 nvmet/__init__.py            |   4 +-
 nvmet/bdev.py                |  72 +++++
 nvmet/nvme.py                |   8 +-
 nvmet/rpc.py                 | 495 +++++++++++++++++++++++++++++++++++
 nvmetadm                     | 259 ++++++++++++++++++
 nvmetcli                     |   4 +-
 nvmetproxy                   | 197 ++++++++++++++
 setup.py                     |   2 +-
 10 files changed, 1157 insertions(+), 19 deletions(-)
 create mode 100644 Documentation/nvmetproxy.txt
 create mode 100644 nvmet/bdev.py
 create mode 100644 nvmet/rpc.py
 create mode 100755 nvmetadm
 create mode 100755 nvmetproxy

-- 
2.29.2




More information about the Linux-nvme mailing list