]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Revert "nvme-cli: Add ioctl retry support for "connect-all""
authorKeith Busch <keith.busch@intel.com>
Wed, 13 Jun 2018 13:31:38 +0000 (07:31 -0600)
committerKeith Busch <keith.busch@intel.com>
Wed, 13 Jun 2018 13:31:38 +0000 (07:31 -0600)
This reverts commit d8f949c21e9d832149518f26c71dfd8de16cd628.

The kernel side was not ready, so this needs more sorting.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme-ioctl.c
nvme-ioctl.h

index d2825389fd698c24b639e4e04ccccea62e844a04..63ff8fb081f475b7030a5feea1dec5ee5a25e616 100644 (file)
 
 #include "nvme-ioctl.h"
 
-static int nvme_do_ioctl(int fd, int rqst, void *cmd, int maxretry)
-{
-       int ret = 0, retry;
-
-       for (retry = 0 ; retry <= maxretry; retry++) {
-               ret = ioctl(fd, rqst, cmd);
-               if (ret != -1 || errno != EAGAIN)
-                       break;
-
-               usleep(IOCTL_DELAY);
-       }
-       return ret;
-}
-
 static int nvme_verify_chr(int fd)
 {
        static struct stat nvme_stat;
@@ -109,12 +95,6 @@ static int nvme_submit_admin_passthru(int fd, struct nvme_passthru_cmd *cmd)
        return ioctl(fd, NVME_IOCTL_ADMIN_CMD, cmd);
 }
 
-static int nvme_submit_admin_passthru_retry(int fd,
-                       struct nvme_passthru_cmd *cmd, int maxretry)
-{
-       return nvme_do_ioctl(fd, NVME_IOCTL_ADMIN_CMD, cmd, maxretry);
-}
-
 static int nvme_submit_io_passthru(int fd, struct nvme_passthru_cmd *cmd)
 {
        return ioctl(fd, NVME_IOCTL_IO_CMD, cmd);
@@ -433,11 +413,7 @@ int nvme_get_log13(int fd, __u32 nsid, __u8 log_id, __u8 lsp, __u64 lpo,
        cmd.cdw12 = lpo;
        cmd.cdw13 = (lpo >> 32);
 
-       if (log_id == NVME_LOG_DISC)
-               return nvme_submit_admin_passthru_retry(fd, &cmd,
-                               DISCOVERY_RETRIES);
-       else
-               return nvme_submit_admin_passthru(fd, &cmd);
+       return nvme_submit_admin_passthru(fd, &cmd);
 
 }
 
index 0d58be87345d14b5e026e9e36788a8f3ff27cefe..6d4ac9586352ce3427340a4391f2f5f7596b21f5 100644 (file)
@@ -6,14 +6,6 @@
 #include "linux/nvme_ioctl.h"
 #include "nvme.h"
 
-/* rate of ioctl retries */
-#define IOCTL_TIMESPERSEC      4
-/* delay between retries. Units in us */
-#define IOCTL_DELAY            (1000000 / IOCTL_TIMESPERSEC)   /* 250ms */
-
-#define NO_RETRIES             0
-#define DISCOVERY_RETRIES      (IOCTL_TIMESPERSEC * 60)        /* 60s */
-
 int nvme_get_nsid(int fd);
 
 /* Generic passthrough */