From 320c7fb8253bfbc96897e611a8f36be684e647e7 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Wed, 7 Dec 2016 23:38:48 +0800 Subject: [PATCH] nvme: drop Set Features of Keep Alive Timeout The NVMe over Fabrics transports should already be setting this in the initial admin queue Connect command, so setting it again is not useful. The kernel NVMe over Fabrics target additionally has a bug in the Set Features - Keep Alive Timeout handler (it is extracting the KATO value from the wrong offset in the command), so this works around the kernel bug by not sending the Set Features command at all. Change-Id: I0d7f09b71fcea116acf8810c5880157bb9315a04 Signed-off-by: Ziye Yang --- lib/nvme/nvme_ctrlr.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c index 48c00a0ff..b42ae619b 100644 --- a/lib/nvme/nvme_ctrlr.c +++ b/lib/nvme/nvme_ctrlr.c @@ -656,29 +656,6 @@ nvme_ctrlr_set_keep_alive_timeout(struct spdk_nvme_ctrlr *ctrlr) return 0; } - SPDK_TRACELOG(SPDK_TRACE_NVME, "Setting keep alive timeout feature to %u ms\n", - ctrlr->opts.keep_alive_timeout_ms); - - status.done = false; - rc = spdk_nvme_ctrlr_cmd_set_feature(ctrlr, SPDK_NVME_FEAT_KEEP_ALIVE_TIMER, - ctrlr->opts.keep_alive_timeout_ms, 0, NULL, 0, - nvme_completion_poll_cb, &status); - if (rc != 0) { - SPDK_ERRLOG("Keep alive timeout Set Feature failed: %d\n", rc); - ctrlr->opts.keep_alive_timeout_ms = 0; - return rc; - } - - while (status.done == false) { - spdk_nvme_qpair_process_completions(ctrlr->adminq, 0); - } - if (spdk_nvme_cpl_is_error(&status.cpl)) { - SPDK_ERRLOG("Keep alive timeout Set Feature failed: SC %x SCT %x\n", - status.cpl.status.sc, status.cpl.status.sct); - ctrlr->opts.keep_alive_timeout_ms = 0; - return -ENXIO; - } - /* Retrieve actual keep alive timeout, since the controller may have adjusted it. */ status.done = false; rc = spdk_nvme_ctrlr_cmd_get_feature(ctrlr, SPDK_NVME_FEAT_KEEP_ALIVE_TIMER, 0, NULL, 0,