Skip to content

Commit 7dc3bfc

Browse files
Chunguang Xukeithbusch
authored andcommitted
nvme-fabrics: use reserved tag for reg read/write command
In some scenarios, if too many commands are issued by nvme command in the same time by user tasks, this may exhaust all tags of admin_q. If a reset (nvme reset or IO timeout) occurs before these commands finish, reconnect routine may fail to update nvme regs due to insufficient tags, which will cause kernel hang forever. In order to workaround this issue, maybe we can let reg_read32()/reg_read64()/reg_write32() use reserved tags. This maybe safe for nvmf: 1. For the disable ctrl path, we will not issue connect command 2. For the enable ctrl / fw activate path, since connect and reg_xx() are called serially. So the reserved tags may still be enough while reg_xx() use reserved tags. Signed-off-by: Chunguang Xu <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 29459c3 commit 7dc3bfc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvme/host/fabrics.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val)
180180
cmd.prop_get.offset = cpu_to_le32(off);
181181

182182
ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res, NULL, 0,
183-
NVME_QID_ANY, 0);
183+
NVME_QID_ANY, NVME_SUBMIT_RESERVED);
184184

185185
if (ret >= 0)
186186
*val = le64_to_cpu(res.u64);
@@ -226,7 +226,7 @@ int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val)
226226
cmd.prop_get.offset = cpu_to_le32(off);
227227

228228
ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res, NULL, 0,
229-
NVME_QID_ANY, 0);
229+
NVME_QID_ANY, NVME_SUBMIT_RESERVED);
230230

231231
if (ret >= 0)
232232
*val = le64_to_cpu(res.u64);
@@ -271,7 +271,7 @@ int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)
271271
cmd.prop_set.value = cpu_to_le64(val);
272272

273273
ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, NULL, NULL, 0,
274-
NVME_QID_ANY, 0);
274+
NVME_QID_ANY, NVME_SUBMIT_RESERVED);
275275
if (unlikely(ret))
276276
dev_err(ctrl->device,
277277
"Property Set error: %d, offset %#x\n",

0 commit comments

Comments
 (0)