nvmf: add NVMe I/O passthru for virtual mode
Change-Id: I338f47000a1c898309a7421fe52f148bae9f2e6b Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/364116 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
eba5c996c8
commit
887683858b
@ -488,6 +488,20 @@ nvmf_virtual_ctrlr_dsm_cmd(struct spdk_bdev *bdev, struct spdk_io_channel *ch,
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
static int
|
||||
nvmf_virtual_ctrlr_nvme_passthru_io(struct spdk_bdev *bdev, struct spdk_io_channel *ch,
|
||||
struct spdk_nvmf_request *req)
|
||||
{
|
||||
if (spdk_bdev_nvme_io_passthru(bdev, ch, &req->cmd->nvme_cmd, req->data, req->length,
|
||||
nvmf_virtual_ctrlr_complete_cmd, req) == NULL) {
|
||||
req->rsp->nvme_cpl.status.sct = SPDK_NVME_SCT_GENERIC;
|
||||
req->rsp->nvme_cpl.status.sc = SPDK_NVME_SC_INVALID_OPCODE;
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_ASYNCHRONOUS;
|
||||
}
|
||||
|
||||
static int
|
||||
nvmf_virtual_ctrlr_process_io_cmd(struct spdk_nvmf_request *req)
|
||||
{
|
||||
@ -519,9 +533,7 @@ nvmf_virtual_ctrlr_process_io_cmd(struct spdk_nvmf_request *req)
|
||||
case SPDK_NVME_OPC_DATASET_MANAGEMENT:
|
||||
return nvmf_virtual_ctrlr_dsm_cmd(bdev, ch, req);
|
||||
default:
|
||||
SPDK_ERRLOG("Unsupported IO command opc: %x\n", cmd->opc);
|
||||
response->status.sc = SPDK_NVME_SC_INVALID_OPCODE;
|
||||
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
|
||||
return nvmf_virtual_ctrlr_nvme_passthru_io(bdev, ch, req);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,16 @@ struct spdk_bdev_io *spdk_bdev_read(struct spdk_bdev *bdev, struct spdk_io_chann
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct spdk_bdev_io *
|
||||
spdk_bdev_nvme_io_passthru(struct spdk_bdev *bdev,
|
||||
struct spdk_io_channel *ch,
|
||||
const struct spdk_nvme_cmd *cmd,
|
||||
void *buf, size_t nbytes,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int spdk_bdev_free_io(struct spdk_bdev_io *bdev_io)
|
||||
{
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user