Enabling pipelining for zoned writes. Increase the number of retries for zoned writes to the maximum number of outstanding commands per hardware queue. Cc: Christoph Hellwig <hch@xxxxxx> Cc: Keith Busch <kbusch@xxxxxxxxxx> Cc: Sagi Grimberg <sagi@xxxxxxxxxxx> Cc: Chaitanya Kulkarni <kch@xxxxxxxxxx> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- drivers/nvme/host/core.c | 6 ++++++ drivers/nvme/host/zns.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index df9ac7fab9b8..3f71d3d82d5e 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -854,6 +854,12 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns, if (req->cmd_flags & REQ_RAHEAD) dsmgmt |= NVME_RW_DSM_FREQ_PREFETCH; + if (blk_queue_pipeline_zoned_writes(req->q) && + blk_rq_is_seq_zone_write(req)) + nvme_req(req)->max_retries = + min(0UL + type_max(typeof(nvme_req(req)->max_retries)), + nvme_req(req)->max_retries + req->q->nr_requests); + cmnd->rw.opcode = op; cmnd->rw.flags = 0; cmnd->rw.nsid = cpu_to_le32(ns->head->ns_id); diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c index 9f81beb4df4e..0b10db3b8d3a 100644 --- a/drivers/nvme/host/zns.c +++ b/drivers/nvme/host/zns.c @@ -54,6 +54,8 @@ int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf) struct nvme_id_ns_zns *id; int status; + blk_queue_flag_set(QUEUE_FLAG_PIPELINE_ZONED_WRITES, ns->queue); + /* Driver requires zone append support */ if ((le32_to_cpu(log->iocs[nvme_cmd_zone_append]) & NVME_CMD_EFFECTS_CSUPP)) {