Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* nvme-cli format timeout
@ 2015-07-23 20:03 Paul Grabinar
  2015-07-23 20:11 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Grabinar @ 2015-07-23 20:03 UTC (permalink / raw)


Hi,

I am aware of some NVMe drives that take well over 60 seconds to perform
a format and therefore timeout during the format command issued by nvme-cli.

We might want to consider increasing the timeout. The following patch is
an example to show what I mean.

Thanks.

diff --git a/nvme.c b/nvme.c
index 02f4dec..5c99dea 100644
--- a/nvme.c
+++ b/nvme.c
@@ -51,6 +51,8 @@
 
 #define min(x, y) (x) > (y) ? (y) : (x)
 
+#define	FORMAT_TIMEOUT	120000	// 120 seconds
+
 static int fd;
 static struct stat nvme_stat;
 static const char *devicename;
@@ -2132,6 +2134,7 @@ static int format(int argc, char **argv)
 	cmd.opcode = nvme_admin_format_nvm;
 	cmd.nsid   = cfg.namespace_id;
 	cmd.cdw10  = (cfg.lbaf << 0) | (cfg.ms << 4) | (cfg.pi << 5) | (cfg.pil << 8) | (cfg.ses << 9);
+	cmd.timeout_ms = FORMAT_TIMEOUT;
 
 	err = ioctl(fd, NVME_IOCTL_ADMIN_CMD, &cmd);
 	if (err < 0)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* nvme-cli format timeout
  2015-07-23 20:03 nvme-cli format timeout Paul Grabinar
@ 2015-07-23 20:11 ` Keith Busch
  2015-07-23 20:22   ` Paul Grabinar
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Busch @ 2015-07-23 20:11 UTC (permalink / raw)


On Thu, 23 Jul 2015, Paul Grabinar wrote:
> Hi,
>
> I am aware of some NVMe drives that take well over 60 seconds to perform
> a format and therefore timeout during the format command issued by nvme-cli.
>
> We might want to consider increasing the timeout. The following patch is
> an example to show what I mean.

Good idea. We should probably make this a parameter as well as up
the timeout. Only the passthru command takes the timeout request as a
parameter for some reason.

If you want to post a pull request on github, we can apply it from there.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* nvme-cli format timeout
  2015-07-23 20:11 ` Keith Busch
@ 2015-07-23 20:22   ` Paul Grabinar
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Grabinar @ 2015-07-23 20:22 UTC (permalink / raw)


On 23/07/15 21:11, Keith Busch wrote:
> On Thu, 23 Jul 2015, Paul Grabinar wrote:
>> Hi,
>>
>> I am aware of some NVMe drives that take well over 60 seconds to perform
>> a format and therefore timeout during the format command issued by
>> nvme-cli.
>>
>> We might want to consider increasing the timeout. The following patch is
>> an example to show what I mean.
>
> Good idea. We should probably make this a parameter as well as up
> the timeout. Only the passthru command takes the timeout request as a
> parameter for some reason.
>
> If you want to post a pull request on github, we can apply it from there.
>

Thanks.
I'll post a pull request. As you say though, having a timeout parameter
would probably be even better.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-23 20:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 20:03 nvme-cli format timeout Paul Grabinar
2015-07-23 20:11 ` Keith Busch
2015-07-23 20:22   ` Paul Grabinar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox