Commit 6308a24f authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

nvme: add a new custom transport SPDK_NVME_TRANSPORT_VFIOUSER



The new custom transport can enable NVMe driver running with
NVMe over vfio-user target.

Change-Id: I5f90e8516eaca08fc3eab658b29b760a03326ff7
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5996


Community-CI: Broadcom CI
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent b30d57cd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -47,8 +47,13 @@ are added for Directive Send and Directive Receive command, respectively.

Added a new function `spdk_nvme_ctrlr_reset_subsystem` to perform a NVMe
subsystem reset. Note: The NVMf target does not support the subsystem reset yet.

Add a new function 'spdk_nvme_bytes_to_numd' to transfer bytes to number of
dwords.

Added a new custom transport `SPDK_NVME_TRANSPORT_VFIOUSER` to enable NVMe
driver running with NVMe over vfio-user target.

### event

The pci_whitelist and pci_blacklist members of struct spdk_app_opts have been
+11 −5
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ extern "C" {
#define SPDK_NVME_TRANSPORT_NAME_PCIE		"PCIE"
#define SPDK_NVME_TRANSPORT_NAME_RDMA		"RDMA"
#define SPDK_NVME_TRANSPORT_NAME_TCP		"TCP"
#define SPDK_NVME_TRANSPORT_NAME_VFIOUSER	"VFIOUSER"
#define SPDK_NVME_TRANSPORT_NAME_CUSTOM		"CUSTOM"

#define SPDK_NVMF_PRIORITY_MAX_LEN 4
@@ -320,6 +321,11 @@ enum spdk_nvme_transport_type {
	 */
	SPDK_NVME_TRANSPORT_TCP = SPDK_NVMF_TRTYPE_TCP,

	/**
	 * Custom VFIO User Transport (Not spec defined)
	 */
	SPDK_NVME_TRANSPORT_VFIOUSER = 1024,

	/**
	 * Custom Transport (Not spec defined)
	 */
+7 −0
Original line number Diff line number Diff line
@@ -1030,6 +1030,9 @@ spdk_nvme_trid_populate_transport(struct spdk_nvme_transport_id *trid,
	case SPDK_NVME_TRANSPORT_TCP:
		trstring = SPDK_NVME_TRANSPORT_NAME_TCP;
		break;
	case SPDK_NVME_TRANSPORT_VFIOUSER:
		trstring = SPDK_NVME_TRANSPORT_NAME_VFIOUSER;
		break;
	case SPDK_NVME_TRANSPORT_CUSTOM:
		trstring = SPDK_NVME_TRANSPORT_NAME_CUSTOM;
		break;
@@ -1082,6 +1085,8 @@ spdk_nvme_transport_id_parse_trtype(enum spdk_nvme_transport_type *trtype, const
		*trtype = SPDK_NVME_TRANSPORT_FC;
	} else if (strcasecmp(str, "TCP") == 0) {
		*trtype = SPDK_NVME_TRANSPORT_TCP;
	} else if (strcasecmp(str, "VFIOUSER") == 0) {
		*trtype = SPDK_NVME_TRANSPORT_VFIOUSER;
	} else {
		*trtype = SPDK_NVME_TRANSPORT_CUSTOM;
	}
@@ -1100,6 +1105,8 @@ spdk_nvme_transport_id_trtype_str(enum spdk_nvme_transport_type trtype)
		return "FC";
	case SPDK_NVME_TRANSPORT_TCP:
		return "TCP";
	case SPDK_NVME_TRANSPORT_VFIOUSER:
		return "VFIOUSER";
	case SPDK_NVME_TRANSPORT_CUSTOM:
		return "CUSTOM";
	default: