From 0346dd775ef3c4fcdba3a39e7d7ebb0ddd7e65b5 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 12 Dec 2016 15:05:14 -0700 Subject: [PATCH] nvme: add ADRFAM (address family) to transport ID This isn't used yet in the NVMe library, but it will be necessary later for supporting non-IPv4 addresses. Change-Id: I167ce63ad25b0e0c9aa192b12d764c8d078e67f9 Signed-off-by: Daniel Verkamp --- examples/nvme/identify/identify.c | 1 + examples/nvme/perf/perf.c | 1 + include/spdk/nvme.h | 7 +++++++ lib/nvme/nvme_rdma.c | 2 ++ 4 files changed, 11 insertions(+) diff --git a/examples/nvme/identify/identify.c b/examples/nvme/identify/identify.c index f3f45eec8..f36e75673 100644 --- a/examples/nvme/identify/identify.c +++ b/examples/nvme/identify/identify.c @@ -912,6 +912,7 @@ parse_args(int argc, char **argv) break; case 'a': trid.trtype = SPDK_NVME_TRANSPORT_RDMA; + trid.adrfam = SPDK_NVMF_ADRFAM_IPV4; snprintf(trid.traddr, sizeof(trid.traddr), "%s", optarg); break; case 's': diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 4578ec040..ef38290b7 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -1072,6 +1072,7 @@ register_controllers(void) return 0; } trid.trtype = SPDK_NVME_TRANSPORT_RDMA; + trid.adrfam = SPDK_NVMF_ADRFAM_IPV4; p = (char *)p1 + 1; p1 = strchr(p, ':'); diff --git a/include/spdk/nvme.h b/include/spdk/nvme.h index 500c424b4..6e94bcb0a 100644 --- a/include/spdk/nvme.h +++ b/include/spdk/nvme.h @@ -141,6 +141,13 @@ struct spdk_nvme_transport_id { */ enum spdk_nvme_transport_type trtype; + /** + * Address family of the transport address. + * + * For PCIe, this value is ignored. + */ + enum spdk_nvmf_adrfam adrfam; + /** * Transport address of the NVMe-oF endpoint. For transports which use IP * addressing (e.g. RDMA), this should be an IP address. For PCIe, this diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index ac7de08ab..0d37edf89 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -1133,6 +1133,8 @@ nvme_rdma_ctrlr_scan(const struct spdk_nvme_transport_id *discovery_trid, continue; } + trid.adrfam = entry->adrfam; + /* Ensure that subnqn is null terminated. */ end = memchr(entry->subnqn, '\0', SPDK_NVMF_NQN_MAX_LEN); if (!end) {