Commit 6c2ce122 authored by Alexis Lescouet's avatar Alexis Lescouet Committed by Tomasz Zawadzki
Browse files

nvmf/vfio_user: Add an option to disable compare in vfio_user_transport_opts



Add an option to stop nvmf transport advertising support for both the
compare command and the fused compare_and_write operation in vfio_user
transport.

Signed-off-by: default avatarAlexis Lescouet <alexis.lescouet@nutanix.com>
Change-Id: I3900218c0e9884f86a5c8698a030f8106b64f2f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12919


Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarJohn Levon <levon@movementarian.org>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 16c65744
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -415,6 +415,7 @@ struct nvmf_vfio_user_transport_opts {
	bool					disable_mappable_bar0;
	bool					disable_adaptive_irq;
	bool					disable_shadow_doorbells;
	bool					disable_compare;
};

struct nvmf_vfio_user_transport {
@@ -1116,6 +1117,11 @@ static const struct spdk_json_object_decoder vfio_user_transport_opts_decoder[]
		offsetof(struct nvmf_vfio_user_transport, transport_opts.disable_shadow_doorbells),
		spdk_json_decode_bool, true
	},
	{
		"disable_compare",
		offsetof(struct nvmf_vfio_user_transport, transport_opts.disable_compare),
		spdk_json_decode_bool, true
	},
};

static struct spdk_nvmf_transport *
@@ -4211,9 +4217,11 @@ nvmf_vfio_user_cdata_init(struct spdk_nvmf_transport *transport,
	cdata->ieee[2] = 0x50;
	memset(&cdata->sgls, 0, sizeof(struct spdk_nvme_cdata_sgls));
	cdata->sgls.supported = SPDK_NVME_SGLS_SUPPORTED_DWORD_ALIGNED;
	cdata->oncs.compare = !vu_transport->transport_opts.disable_compare;
	/* libvfio-user can only support 1 connection for now */
	cdata->oncs.reservations = 0;
	cdata->oacs.doorbell_buffer_config = !vu_transport->transport_opts.disable_shadow_doorbells;
	cdata->fuses.compare_and_write = !vu_transport->transport_opts.disable_compare;
}

static int