nutanix / libvfio-user

framework for emulating devices in userspace
BSD 3-Clause "New" or "Revised" License
166 stars 51 forks source link

spdk receives invalid request #361

Closed tmakatos closed 3 years ago

tmakatos commented 3 years ago
.854376] vfio_user.c:2149:map_io_cmd_req: *ERROR*: /var/run/muser/domain/muser0/8: SQ1 invalid I/O request type 0x9
[2021-02-22 12:12:01.854497] vfio_user.c:2207:handle_cmd_req: *ERROR*: /var/run/muser/domain/muser0/8: map NVMe command opc 0x9 failed
[2021-02-22 12:12:01.854528] vfio_user.c: 619:post_completion: *DEBUG*: /var/run/muser/domain/muser0/8: request complete SQ1 cid=4 status=0x6 SQ head=0xe3 CQ tail=0xe2
tmakatos commented 3 years ago

This is SPDK_NVME_OPC_DATASET_MANAGEMENT. Need to check whether this should have been disabled in the first place.

Check figure 245:

Bit 2 if set to ‘1’, then the controller supports the Dataset Management command. If cleared to ‘0’, then the controller does not support the Dataset Management command.

We should disable this in identify.

tmakatos commented 3 years ago

We used to have this:

diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c
index 2f9325700..16b0d2552 100644
--- a/lib/nvmf/vfio_user.c
+++ b/lib/nvmf/vfio_user.c
@@ -569,6 +569,13 @@ handle_identify_ctrlr_rsp(struct spdk_nvme_ctrlr_data *data)
        assert(data != NULL);

        data->sgls.supported = SPDK_NVME_SGLS_NOT_SUPPORTED;
+
+       /*
+        * Intentionally disabled, otherwise we get a
+        * SPDK_NVME_OPC_DATASET_MANAGEMENT command we don't know how to
+        * properly handle.
+        */
+       data->oncs.dsm = 0;
 }

 /*

With the restored it works! Not sure why it was removed.

tmakatos commented 3 years ago

This is currently being fixed upstream (DSM will now be supported): https://review.spdk.io/gerrit/c/spdk/spdk/+/6525/5

jlevon commented 3 years ago

Removed nutanix-tp: we have SPDK changes to disable dataset management

tmakatos commented 3 years ago

Removed nutanix-tp: we have SPDK changes to disable dataset management

@jlevon so we can close this?

jlevon commented 3 years ago

yup