#
2796687d |
| 30-Nov-2022 |
Parameswaran Krishnamurthy <parameswaran.krishna@dell.com> |
nvme: Added support for TP-8009, Auto-discovery of Discovery controllers for NVME initiator using mDNS using Avahi
Approach: Avahi Daemon needs to be running to provide the mDNS server service. In t
nvme: Added support for TP-8009, Auto-discovery of Discovery controllers for NVME initiator using mDNS using Avahi
Approach: Avahi Daemon needs to be running to provide the mDNS server service. In the SPDK, Avahi-client library based client API is implemented. The client API will connect to the Avahi-daemon and receive events for new discovery and removal of an existing discovery entry.
Following sets on new RPCs have been introduced.
scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
User shall initiate an mDNS based discovery using this RPC. This will start a Avahi-client based poller looking for new discovery events from the Avahi server. On a new discovery of the discovery controller, the existing bdev_nvme_start_discovery API will be invoked with the trid of the discovery controller learnt. This will enable automatic connection of the initiator to the subsystems discovered from the discovery controller. Multiple mdns discovery instances can be run by specifying a unique bdev-prefix and a unique servicename to discover as parameters.
scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
This will stop the Avahi poller that was started for the specified service.Internally bdev_nvme_stop_discovery API will be invoked for each of the discovery controllers learnt automatically by this instance of mdns discovery service. This will result in termination of connections to all the subsystems learnt by this mdns discovery instance.
scripts/rpc.py bdev_nvme_get_mdns_discovery_info
This RPC will display the list of mdns discovery instances running and the trid of the controllers discovered by these instances.
Test Result:
root@ubuntu-pm-18-226:~/param-spdk/spdk/build/bin# ./nvmf_tgt -i 1 -s 2048 -m 0xF root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp root@ubuntu-pm-18-226:~/param-spdk/spdk# root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info [ { "name": "cdc_auto", "svcname": "_nvme-disc._tcp", "referrals": [ { "name": "cdc_auto0", "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.2.21", "trsvcid": "8009", "subnqn": "nqn.2014-08.org.nvmexpress.discovery" } }, { "name": "cdc_auto1", "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.1.21", "trsvcid": "8009", "subnqn": "nqn.2014-08.org.nvmexpress.discovery" } } ] } ] root@ubuntu-pm-18-226:~/param-spdk/spdk# root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info [ { "name": "cdc_auto0", "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.2.21", "trsvcid": "8009", "subnqn": "nqn.2014-08.org.nvmexpress.discovery" }, "referrals": [] }, { "name": "cdc_auto1", "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.1.21", "trsvcid": "8009", "subnqn": "nqn.2014-08.org.nvmexpress.discovery" }, "referrals": [] } ] root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs [ { "name": "cdc_auto02n1", "aliases": [ "600110d6-1681-1681-0403-000045805c45" ], "product_name": "NVMe disk", "block_size": 512, "num_blocks": 32768, "uuid": "600110d6-1681-1681-0403-000045805c45", "assigned_rate_limits": { "rw_ios_per_sec": 0, "rw_mbytes_per_sec": 0, "r_mbytes_per_sec": 0, "w_mbytes_per_sec": 0 }, "claimed": false, "zoned": false, "supported_io_types": { "read": true, "write": true, "unmap": true, "write_zeroes": true, "flush": true, "reset": true, "compare": true, "compare_and_write": true, "abort": true, "nvme_admin": true, "nvme_io": true }, "driver_specific": { "nvme": [ { "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.1.40", "trsvcid": "4420", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0" }, "ctrlr_data": { "cntlid": 3, "vendor_id": "0x0000", "model_number": "SANBlaze VLUN P3T0", "serial_number": "00-681681dc681681dc", "firmware_revision": "V10.5", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0", "oacs": { "security": 0, "format": 1, "firmware": 0, "ns_manage": 1 }, "multi_ctrlr": true, "ana_reporting": true }, "vs": { "nvme_version": "2.0" }, "ns_data": { "id": 1, "ana_state": "optimized", "can_share": true } } ], "mp_policy": "active_passive" } }, { "name": "cdc_auto00n1", "aliases": [ "600110da-09a6-09a6-0302-00005eeb19b4" ], "product_name": "NVMe disk", "block_size": 512, "num_blocks": 2048, "uuid": "600110da-09a6-09a6-0302-00005eeb19b4", "assigned_rate_limits": { "rw_ios_per_sec": 0, "rw_mbytes_per_sec": 0, "r_mbytes_per_sec": 0, "w_mbytes_per_sec": 0 }, "claimed": false, "zoned": false, "supported_io_types": { "read": true, "write": true, "unmap": true, "write_zeroes": true, "flush": true, "reset": true, "compare": true, "compare_and_write": true, "abort": true, "nvme_admin": true, "nvme_io": true }, "driver_specific": { "nvme": [ { "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.2.40", "trsvcid": "4420", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0" }, "ctrlr_data": { "cntlid": 1, "vendor_id": "0x0000", "model_number": "SANBlaze VLUN P2T0", "serial_number": "00-ab09a6f5ab09a6f5", "firmware_revision": "V10.5", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0", "oacs": { "security": 0, "format": 1, "firmware": 0, "ns_manage": 1 }, "multi_ctrlr": true, "ana_reporting": true }, "vs": { "nvme_version": "2.0" }, "ns_data": { "id": 1, "ana_state": "optimized", "can_share": true } } ], "mp_policy": "active_passive" } }, { "name": "cdc_auto01n1", "aliases": [ "600110d6-dce8-dce8-0403-00010b2d3d8c" ], "product_name": "NVMe disk", "block_size": 512, "num_blocks": 32768, "uuid": "600110d6-dce8-dce8-0403-00010b2d3d8c", "assigned_rate_limits": { "rw_ios_per_sec": 0, "rw_mbytes_per_sec": 0, "r_mbytes_per_sec": 0, "w_mbytes_per_sec": 0 }, "claimed": false, "zoned": false, "supported_io_types": { "read": true, "write": true, "unmap": true, "write_zeroes": true, "flush": true, "reset": true, "compare": true, "compare_and_write": true, "abort": true, "nvme_admin": true, "nvme_io": true }, "driver_specific": { "nvme": [ { "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.1.40", "trsvcid": "4420", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1" }, "ctrlr_data": { "cntlid": 3, "vendor_id": "0x0000", "model_number": "SANBlaze VLUN P3T1", "serial_number": "01-6ddce86d6ddce86d", "firmware_revision": "V10.5", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1", "oacs": { "security": 0, "format": 1, "firmware": 0, "ns_manage": 1 }, "multi_ctrlr": true, "ana_reporting": true }, "vs": { "nvme_version": "2.0" }, "ns_data": { "id": 1, "ana_state": "optimized", "can_share": true } } ], "mp_policy": "active_passive" } }, { "name": "cdc_auto01n2", "aliases": [ "600110d6-dce8-dce8-0403-00010b2d3d8d" ], "product_name": "NVMe disk", "block_size": 512, "num_blocks": 32768, "uuid": "600110d6-dce8-dce8-0403-00010b2d3d8d", "assigned_rate_limits": { "rw_ios_per_sec": 0, "rw_mbytes_per_sec": 0, "r_mbytes_per_sec": 0, "w_mbytes_per_sec": 0 }, "claimed": false, "zoned": false, "supported_io_types": { "read": true, "write": true, "unmap": true, "write_zeroes": true, "flush": true, "reset": true, "compare": true, "compare_and_write": true, "abort": true, "nvme_admin": true, "nvme_io": true }, "driver_specific": { "nvme": [ { "trid": { "trtype": "TCP", "adrfam": "IPv4", "traddr": "66.1.1.40", "trsvcid": "4420", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1" }, "ctrlr_data": { "cntlid": 3, "vendor_id": "0x0000", "model_number": "SANBlaze VLUN P3T1", "serial_number": "01-6ddce86d6ddce86d", "firmware_revision": "V10.5", "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1", "oacs": { "security": 0, "format": 1, "firmware": 0, "ns_manage": 1 }, "multi_ctrlr": true, "ana_reporting": true }, "vs": { "nvme_version": "2.0" }, "ns_data": { "id": 2, "ana_state": "optimized", "can_share": true } } ], "mp_policy": "active_passive" } } ] root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto root@ubuntu-pm-18-226:~/param-spdk/spdk# root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info [] root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info [] root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs [] root@ubuntu-pm-18-226:~/param-spdk/spdk#
Signed-off-by: Parameswaran Krishnamurthy <parameswaran.krishna@dell.com> Change-Id: Ic2c2e614e2549a655c7f81ae844b80d8505a4f02 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15703 Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Boris Glimcher <Boris.Glimcher@emc.com> Reviewed-by: <qun.wan@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|