Commit 762a11df authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Christoph Hellwig

nvmet: add error log support for rdma backend

This patch adds the support to maintain the error log page for rdma
transport, we mainly focus here on the NVME_INVALID_FIELD errors.
Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 84faf42b
...@@ -630,8 +630,11 @@ static u16 nvmet_rdma_map_sgl_inline(struct nvmet_rdma_rsp *rsp) ...@@ -630,8 +630,11 @@ static u16 nvmet_rdma_map_sgl_inline(struct nvmet_rdma_rsp *rsp)
u64 off = le64_to_cpu(sgl->addr); u64 off = le64_to_cpu(sgl->addr);
u32 len = le32_to_cpu(sgl->length); u32 len = le32_to_cpu(sgl->length);
if (!nvme_is_write(rsp->req.cmd)) if (!nvme_is_write(rsp->req.cmd)) {
rsp->req.error_loc =
offsetof(struct nvme_common_command, opcode);
return NVME_SC_INVALID_FIELD | NVME_SC_DNR; return NVME_SC_INVALID_FIELD | NVME_SC_DNR;
}
if (off + len > rsp->queue->dev->inline_data_size) { if (off + len > rsp->queue->dev->inline_data_size) {
pr_err("invalid inline data offset!\n"); pr_err("invalid inline data offset!\n");
...@@ -696,6 +699,8 @@ static u16 nvmet_rdma_map_sgl(struct nvmet_rdma_rsp *rsp) ...@@ -696,6 +699,8 @@ static u16 nvmet_rdma_map_sgl(struct nvmet_rdma_rsp *rsp)
return nvmet_rdma_map_sgl_inline(rsp); return nvmet_rdma_map_sgl_inline(rsp);
default: default:
pr_err("invalid SGL subtype: %#x\n", sgl->type); pr_err("invalid SGL subtype: %#x\n", sgl->type);
rsp->req.error_loc =
offsetof(struct nvme_common_command, dptr);
return NVME_SC_INVALID_FIELD | NVME_SC_DNR; return NVME_SC_INVALID_FIELD | NVME_SC_DNR;
} }
case NVME_KEY_SGL_FMT_DATA_DESC: case NVME_KEY_SGL_FMT_DATA_DESC:
...@@ -706,10 +711,13 @@ static u16 nvmet_rdma_map_sgl(struct nvmet_rdma_rsp *rsp) ...@@ -706,10 +711,13 @@ static u16 nvmet_rdma_map_sgl(struct nvmet_rdma_rsp *rsp)
return nvmet_rdma_map_sgl_keyed(rsp, sgl, false); return nvmet_rdma_map_sgl_keyed(rsp, sgl, false);
default: default:
pr_err("invalid SGL subtype: %#x\n", sgl->type); pr_err("invalid SGL subtype: %#x\n", sgl->type);
rsp->req.error_loc =
offsetof(struct nvme_common_command, dptr);
return NVME_SC_INVALID_FIELD | NVME_SC_DNR; return NVME_SC_INVALID_FIELD | NVME_SC_DNR;
} }
default: default:
pr_err("invalid SGL type: %#x\n", sgl->type); pr_err("invalid SGL type: %#x\n", sgl->type);
rsp->req.error_loc = offsetof(struct nvme_common_command, dptr);
return NVME_SC_SGL_INVALID_TYPE | NVME_SC_DNR; return NVME_SC_SGL_INVALID_TYPE | NVME_SC_DNR;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment