]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: update keep alive interval when kato is modified
authorTatsuya Sasaki <tatsuya6.sasaki@kioxia.com>
Wed, 1 Sep 2021 08:23:42 +0000 (08:23 +0000)
committerChristoph Hellwig <hch@lst.de>
Mon, 6 Sep 2021 08:03:11 +0000 (10:03 +0200)
commit5fbed9ab74e9ffaa9ae97dea1ac3dd4bcbfe8497
treeaed70c2f304b25dfeb2ea583f49354d740ca53eb
parent04f2f0afaa1824d33aa0c308b0c498f47bb47eb6
nvme: update keep alive interval when kato is modified

Currently the connection between host and NVMe-oF target gets
disconnected by keep-alive timeout when a user connects to a target
with a relatively large kato value and then sets the smaller kato
with a set features command (e.g. connects with 60 seconds kato value
and then sets 10 seconds kato value).

The cause is that keep alive command interval on the host, which is
defined as unsigned int kato in nvme_ctrl structure, does not follow
the kato value changes.

This patch updates the keep alive interval in the following steps when
the kato is modified by a set features command: stops the keep alive
work queue, then sets the kato as new timer value and re-start the queue.

Signed-off-by: Tatsuya Sasaki <tatsuya6.sasaki@kioxia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c