nvmf: Add Fibre Channel defs and usage to nvme lib
Add FC definitions to nvme header and library functions. Change-Id: I8980f55d834c1e1d4f415756cb7a46a3ff1c7db3 Signed-off-by: John Barnard <john.barnard@broadcom.com> Reviewed-on: https://review.gerrithub.io/416434 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
b7322649db
commit
79cffd37ca
@ -183,6 +183,11 @@ enum spdk_nvme_transport_type {
|
|||||||
* RDMA Transport (RoCE, iWARP, etc.)
|
* RDMA Transport (RoCE, iWARP, etc.)
|
||||||
*/
|
*/
|
||||||
SPDK_NVME_TRANSPORT_RDMA = SPDK_NVMF_TRTYPE_RDMA,
|
SPDK_NVME_TRANSPORT_RDMA = SPDK_NVMF_TRTYPE_RDMA,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fibre Channel (FC) Transport
|
||||||
|
*/
|
||||||
|
SPDK_NVME_TRANSPORT_FC = SPDK_NVMF_TRTYPE_FC,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -210,14 +215,16 @@ struct spdk_nvme_transport_id {
|
|||||||
* Transport address of the NVMe-oF endpoint. For transports which use IP
|
* 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
|
* addressing (e.g. RDMA), this should be an IP address. For PCIe, this
|
||||||
* can either be a zero length string (the whole bus) or a PCI address
|
* can either be a zero length string (the whole bus) or a PCI address
|
||||||
* in the format DDDD:BB:DD.FF or DDDD.BB.DD.FF
|
* in the format DDDD:BB:DD.FF or DDDD.BB.DD.FF. For FC the string is
|
||||||
|
* formatted as: nn-0xWWNN:pn-0xWWPN” where a)WWN isthe Node_Name of the
|
||||||
|
* target NVMe_Port and b)WWPN is the N_Port_Name of the target NVMe_Port.
|
||||||
*/
|
*/
|
||||||
char traddr[SPDK_NVMF_TRADDR_MAX_LEN + 1];
|
char traddr[SPDK_NVMF_TRADDR_MAX_LEN + 1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transport service id of the NVMe-oF endpoint. For transports which use
|
* Transport service id of the NVMe-oF endpoint. For transports which use
|
||||||
* IP addressing (e.g. RDMA), this field shoud be the port number. For PCIe,
|
* IP addressing (e.g. RDMA), this field shoud be the port number. For PCIe,
|
||||||
* this is always a zero length string.
|
* and FC this is always a zero length string.
|
||||||
*/
|
*/
|
||||||
char trsvcid[SPDK_NVMF_TRSVCID_MAX_LEN + 1];
|
char trsvcid[SPDK_NVMF_TRSVCID_MAX_LEN + 1];
|
||||||
|
|
||||||
@ -241,7 +248,7 @@ struct spdk_nvme_transport_id {
|
|||||||
* ------------ | -----
|
* ------------ | -----
|
||||||
* trtype | Transport type (e.g. PCIe, RDMA)
|
* trtype | Transport type (e.g. PCIe, RDMA)
|
||||||
* adrfam | Address family (e.g. IPv4, IPv6)
|
* adrfam | Address family (e.g. IPv4, IPv6)
|
||||||
* traddr | Transport address (e.g. 0000:04:00.0 for PCIe or 192.168.100.8 for RDMA)
|
* traddr | Transport address (e.g. 0000:04:00.0 for PCIe, 192.168.100.8 for RDMA, or WWN for FC)
|
||||||
* trsvcid | Transport service identifier (e.g. 4420)
|
* trsvcid | Transport service identifier (e.g. 4420)
|
||||||
* subnqn | Subsystem NQN
|
* subnqn | Subsystem NQN
|
||||||
*
|
*
|
||||||
|
@ -645,6 +645,8 @@ spdk_nvme_transport_id_parse_trtype(enum spdk_nvme_transport_type *trtype, const
|
|||||||
*trtype = SPDK_NVME_TRANSPORT_PCIE;
|
*trtype = SPDK_NVME_TRANSPORT_PCIE;
|
||||||
} else if (strcasecmp(str, "RDMA") == 0) {
|
} else if (strcasecmp(str, "RDMA") == 0) {
|
||||||
*trtype = SPDK_NVME_TRANSPORT_RDMA;
|
*trtype = SPDK_NVME_TRANSPORT_RDMA;
|
||||||
|
} else if (strcasecmp(str, "FC") == 0) {
|
||||||
|
*trtype = SPDK_NVME_TRANSPORT_FC;
|
||||||
} else {
|
} else {
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
@ -659,6 +661,8 @@ spdk_nvme_transport_id_trtype_str(enum spdk_nvme_transport_type trtype)
|
|||||||
return "PCIe";
|
return "PCIe";
|
||||||
case SPDK_NVME_TRANSPORT_RDMA:
|
case SPDK_NVME_TRANSPORT_RDMA:
|
||||||
return "RDMA";
|
return "RDMA";
|
||||||
|
case SPDK_NVME_TRANSPORT_FC:
|
||||||
|
return "FC";
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -57,11 +57,13 @@ nvme_transport_unknown(enum spdk_nvme_transport_type trtype)
|
|||||||
#define TRANSPORT_FABRICS_RDMA(func_name, args) case SPDK_NVME_TRANSPORT_RDMA: SPDK_UNREACHABLE();
|
#define TRANSPORT_FABRICS_RDMA(func_name, args) case SPDK_NVME_TRANSPORT_RDMA: SPDK_UNREACHABLE();
|
||||||
#define TRANSPORT_RDMA_AVAILABLE false
|
#define TRANSPORT_RDMA_AVAILABLE false
|
||||||
#endif
|
#endif
|
||||||
|
#define TRANSPORT_FABRICS_FC(func_name, args) case SPDK_NVME_TRANSPORT_FC: SPDK_UNREACHABLE();
|
||||||
#define NVME_TRANSPORT_CALL(trtype, func_name, args) \
|
#define NVME_TRANSPORT_CALL(trtype, func_name, args) \
|
||||||
do { \
|
do { \
|
||||||
switch (trtype) { \
|
switch (trtype) { \
|
||||||
TRANSPORT_PCIE(func_name, args) \
|
TRANSPORT_PCIE(func_name, args) \
|
||||||
TRANSPORT_FABRICS_RDMA(func_name, args) \
|
TRANSPORT_FABRICS_RDMA(func_name, args) \
|
||||||
|
TRANSPORT_FABRICS_FC(func_name, args) \
|
||||||
TRANSPORT_DEFAULT(trtype) \
|
TRANSPORT_DEFAULT(trtype) \
|
||||||
} \
|
} \
|
||||||
SPDK_UNREACHABLE(); \
|
SPDK_UNREACHABLE(); \
|
||||||
@ -76,6 +78,9 @@ spdk_nvme_transport_available(enum spdk_nvme_transport_type trtype)
|
|||||||
|
|
||||||
case SPDK_NVME_TRANSPORT_RDMA:
|
case SPDK_NVME_TRANSPORT_RDMA:
|
||||||
return TRANSPORT_RDMA_AVAILABLE;
|
return TRANSPORT_RDMA_AVAILABLE;
|
||||||
|
|
||||||
|
case SPDK_NVME_TRANSPORT_FC:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user