lib/nvme: implement SPDK_NVME_DATA_NONE data transfer in CUSE
Change-Id: Ifb2a53bdbaabd74b7f412923a97d79b44afde861 Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com> Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1744 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
parent
a9b5d7af5a
commit
549b9f31c6
@ -102,7 +102,8 @@ cuse_nvme_admin_cmd_cb(void *arg, const struct spdk_nvme_cpl *cpl)
|
|||||||
struct iovec out_iov[2];
|
struct iovec out_iov[2];
|
||||||
struct spdk_nvme_cpl _cpl;
|
struct spdk_nvme_cpl _cpl;
|
||||||
|
|
||||||
if (ctx->data_transfer == SPDK_NVME_DATA_HOST_TO_CONTROLLER) {
|
if (ctx->data_transfer == SPDK_NVME_DATA_HOST_TO_CONTROLLER ||
|
||||||
|
ctx->data_transfer == SPDK_NVME_DATA_NONE) {
|
||||||
fuse_reply_ioctl_iov(ctx->req, cpl->status.sc, NULL, 0);
|
fuse_reply_ioctl_iov(ctx->req, cpl->status.sc, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
memcpy(&_cpl, cpl, sizeof(struct spdk_nvme_cpl));
|
memcpy(&_cpl, cpl, sizeof(struct spdk_nvme_cpl));
|
||||||
@ -206,10 +207,6 @@ cuse_nvme_admin_cmd(fuse_req_t req, int cmd, void *arg,
|
|||||||
admin_cmd = (struct nvme_admin_cmd *)in_buf;
|
admin_cmd = (struct nvme_admin_cmd *)in_buf;
|
||||||
|
|
||||||
switch (spdk_nvme_opc_get_data_transfer(admin_cmd->opcode)) {
|
switch (spdk_nvme_opc_get_data_transfer(admin_cmd->opcode)) {
|
||||||
case SPDK_NVME_DATA_NONE:
|
|
||||||
SPDK_ERRLOG("SPDK_NVME_DATA_NONE not implemented\n");
|
|
||||||
fuse_reply_err(req, EINVAL);
|
|
||||||
return;
|
|
||||||
case SPDK_NVME_DATA_HOST_TO_CONTROLLER:
|
case SPDK_NVME_DATA_HOST_TO_CONTROLLER:
|
||||||
if (admin_cmd->addr != 0) {
|
if (admin_cmd->addr != 0) {
|
||||||
in_iov[1].iov_base = (void *)admin_cmd->addr;
|
in_iov[1].iov_base = (void *)admin_cmd->addr;
|
||||||
@ -223,6 +220,7 @@ cuse_nvme_admin_cmd(fuse_req_t req, int cmd, void *arg,
|
|||||||
cuse_nvme_admin_cmd_send(req, admin_cmd, NULL);
|
cuse_nvme_admin_cmd_send(req, admin_cmd, NULL);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case SPDK_NVME_DATA_NONE:
|
||||||
case SPDK_NVME_DATA_CONTROLLER_TO_HOST:
|
case SPDK_NVME_DATA_CONTROLLER_TO_HOST:
|
||||||
if (out_bufsz == 0) {
|
if (out_bufsz == 0) {
|
||||||
out_iov[0].iov_base = &((struct nvme_admin_cmd *)arg)->result;
|
out_iov[0].iov_base = &((struct nvme_admin_cmd *)arg)->result;
|
||||||
|
@ -105,5 +105,10 @@ if [ ! -c "$ctrlr" ]; then
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Verify admin cmd when no data is transferred,
|
||||||
|
# by creating and deleting completion queue.
|
||||||
|
${NVME_CMD} admin-passthru $ctrlr -o 5 --cdw10=0x3ff0003 --cdw11=0x1 -r
|
||||||
|
${NVME_CMD} admin-passthru $ctrlr -o 4 --cdw10=0x3
|
||||||
|
|
||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
killprocess $spdk_tgt_pid
|
killprocess $spdk_tgt_pid
|
||||||
|
Loading…
Reference in New Issue
Block a user