Skip to contentSkip to conversation

multipath-tools/libmultipath: Support for the native NVMe Ioctl command and add args min_avg_latency for path_latency.

PATCH In review Yang Feng 3 participants 9 messages Jul 13, 2017 – Jul 19, 2017 Device mapper

lore
Share & tools
lore

Yang Feng

author
#0 lore raw

cover multipath-tools/libmultipath: Support for the native NVMe Ioctl command and add args min_avg_latency for path_latency.

1. The SCSI-to-NVMe translations have been removed in the patch "nvme:
Remove SCSI translations" in the linux-nvme, so the native NVMe Ioctl command should be supported in the multipath-tools.
In the prioritizers/path_latency.c, modify the func do_readsector0():
send a native NVMe Read Ioctl command to the nvme device, and send a SG Read Ioctl command to the scsi device.
In the checkers, delete the file tur.c and create the new file ping.c:
ping.c can support the native NVMe Keep Alive Ioctl command to the nvme device, and can support the SG TUR Ioctl command to the scsi device.
2. Add args min_avg_latency of logarithmic scale, for prioritizers/ path_latency.c. Min average latency is not constant 1us, and can be set by user. Certainly, max average latency value is still constant 100s. It make support better for more scenes, because it can deal better with the normal standard deviation of path latency.
For example, when the standard deviation value is 200us and the average
latency of the normal paths is 1ms, args base_num can be set to 5 and args min_avg_latency can be set to 2ms, so the paths will be grouped in priority groups with path latency <=2ms, (2ms, 10ms], (10ms, 50ms], etc.

Yang Feng (1):
multipath-tools/libmultipath: Support for the native NVMe Ioctl command
and add args min_avg_latency for path_latency.

 libmultipath/checkers.c                  |   7 +
 libmultipath/checkers.h                  |   6 +-
 libmultipath/checkers/Makefile           |   6 +-
 libmultipath/checkers/emc_clariion.c     |   4 +-
 libmultipath/checkers/libsg.c            |  94 -------
 libmultipath/checkers/libsg.h            |   9 -
 libmultipath/checkers/ping.c             | 453 +++++++++++++++++++++++++++++++
 libmultipath/checkers/readsector0.c      |   4 +-
 libmultipath/checkers/tur.c              | 427 -----------------------------
 libmultipath/checkers/tur.h              |   8 -
 libmultipath/defaults.h                  |   2 +-
 libmultipath/discovery.c                 |   1 +
 libmultipath/hwtable.c                   |   2 +-
 libmultipath/libnvme.c                   | 130 +++++++++
 libmultipath/libnvme.h                   |  10 +
 libmultipath/libsg.c                     | 113 ++++++++
 libmultipath/libsg.h                     |  13 +
 libmultipath/prioritizers/Makefile       |   2 +-
 libmultipath/prioritizers/path_latency.c |  95 ++++---
 libmultipath/propsel.c                   |   2 +-
 multipath/multipath.conf.5               |  18 +-
 21 files changed, 821 insertions(+), 585 deletions(-)
 delete mode 100644 libmultipath/checkers/libsg.c
 delete mode 100644 libmultipath/checkers/libsg.h
 create mode 100644 libmultipath/checkers/ping.c
 delete mode 100644 libmultipath/checkers/tur.c
 delete mode 100644 libmultipath/checkers/tur.h
 create mode 100644 libmultipath/libnvme.c
 create mode 100644 libmultipath/libnvme.h
 create mode 100644 libmultipath/libsg.c
 create mode 100644 libmultipath/libsg.h
Signature · 1 line
2.6.4.windows.1
author
#1 lore raw

PATCH 1/2 multipath-tools/libmultipath: Support for the native NVMe Ioctl command.

1. The SCSI-to-NVMe translations have been removed in the patch "nvme:
Remove SCSI translations" in the linux-nvme, so the native NVMe Ioctl command should be supported in the multipath-tools.
2. In the prioritizers/path_latency.c, modify the func do_readsector0():
send a native NVMe Read Ioctl command to the nvme device, and send a SG Read Ioctl command to the scsi device.
3. In the checkers, delete the file tur.c and create the new file ping.c:
ping.c can support the native NVMe Keep Alive Ioctl command to the nvme device, and can support the SG TUR Ioctl command to the scsi device.

---
 libmultipath/checkers.c                  |   7 +
 libmultipath/checkers.h                  |   6 +-
 libmultipath/checkers/Makefile           |   6 +-
 libmultipath/checkers/emc_clariion.c     |   4 +-
 libmultipath/checkers/libsg.c            |  94 -------
 libmultipath/checkers/libsg.h            |   9 -
 libmultipath/checkers/ping.c             | 453 +++++++++++++++++++++++++++++++
 libmultipath/checkers/readsector0.c      |   4 +-
 libmultipath/checkers/tur.c              | 427 -----------------------------
 libmultipath/checkers/tur.h              |   8 -
 libmultipath/defaults.h                  |   2 +-
 libmultipath/discovery.c                 |   1 +
 libmultipath/hwtable.c                   |   2 +-
 libmultipath/libnvme.c                   | 130 +++++++++
 libmultipath/libnvme.h                   |  10 +
 libmultipath/libsg.c                     | 113 ++++++++
 libmultipath/libsg.h                     |  13 +
 libmultipath/prioritizers/Makefile       |   2 +-
 libmultipath/prioritizers/path_latency.c |  58 +---
 libmultipath/propsel.c                   |   2 +-
 multipath/multipath.conf.5               |   4 +-
 21 files changed, 754 insertions(+), 601 deletions(-)
 delete mode 100644 libmultipath/checkers/libsg.c
 delete mode 100644 libmultipath/checkers/libsg.h
 create mode 100644 libmultipath/checkers/ping.c
 delete mode 100644 libmultipath/checkers/tur.c
 delete mode 100644 libmultipath/checkers/tur.h
 create mode 100644 libmultipath/libnvme.c
 create mode 100644 libmultipath/libnvme.h
 create mode 100644 libmultipath/libsg.c
 create mode 100644 libmultipath/libsg.h
libmultipath/checkers.c +7 -0
index 05e024f..00fbd6e 100644
@@ -162,6 +162,13 @@ void checker_set_fd (struct checker * c, int fd)
 	c->fd = fd;
 }
 
+void checker_set_dev(struct checker *c, char *dev)
+{
+    if (!c)
+        return;
+    strncpy(c->dev, dev, strlen(dev)+1);
+}
+
 void checker_set_sync (struct checker * c)
 {
 	if (!c)
libmultipath/checkers.h +5 -1
index 1d225de..506dd4c 100644
@@ -79,7 +79,7 @@ enum path_check_state {
 };
 
 #define DIRECTIO     "directio"
-#define TUR          "tur"
+#define PING         "ping"
 #define HP_SW        "hp_sw"
 #define RDAC         "rdac"
 #define EMC_CLARIION "emc_clariion"
@@ -97,6 +97,8 @@ enum path_check_state {
 #define CHECKER_DEV_LEN 256
 #define LIB_CHECKER_NAMELEN 256
 
+#define FILE_NAME_SIZE  256
+
 struct checker {
 	struct list_head node;
 	void *handle;
@@ -107,6 +109,7 @@ struct checker {
 	int disable;
 	char name[CHECKER_NAME_LEN];
 	char message[CHECKER_MSG_LEN];       /* comm with callers */
+    char dev[FILE_NAME_SIZE];
 	void * context;                      /* store for persistent data */
 	void ** mpcontext;                   /* store for persistent data shared
 						multipath-wide. Use MALLOC if
@@ -132,6 +135,7 @@ void checker_reset (struct checker *);
 void checker_set_sync (struct checker *);
 void checker_set_async (struct checker *);
 void checker_set_fd (struct checker *, int);
+void checker_set_dev(struct checker *c, char *dev);
 void checker_enable (struct checker *);
 void checker_disable (struct checker *);
 void checker_repair (struct checker *);
libmultipath/checkers/Makefile +3 -3
index bce6b8b..3ab04ef 100644
@@ -9,7 +9,7 @@ CFLAGS += $(LIB_CFLAGS) -I..
 LIBS= \
 	libcheckcciss_tur.so \
 	libcheckreadsector0.so \
-	libchecktur.so \
+	libcheckping.so \
 	libcheckdirectio.so \
 	libcheckemc_clariion.so \
 	libcheckhp_sw.so \
@@ -24,10 +24,10 @@ all: $(LIBS)
 libcheckrbd.so: rbd.o
 	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -lrados -ludev
 
-libcheckdirectio.so: libsg.o directio.o
+libcheckdirectio.so: ../libsg.o ../libnvme.o directio.o
 	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -laio
 
-libcheck%.so: libsg.o %.o
+libcheck%.so: ../libsg.o ../libnvme.o %.o
 	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^
 
 install:
libmultipath/checkers/emc_clariion.c +3 -1
index 9c1ffed..12c1e3e 100644
@@ -12,7 +12,7 @@
 #include <errno.h>
 
 #include "../libmultipath/sg_include.h"
-#include "libsg.h"
+#include "../libmultipath/libsg.h"
 #include "checkers.h"
 #include "debug.h"
 #include "memory.h"
@@ -21,6 +21,8 @@
 #define INQUIRY_CMDLEN  6
 #define HEAVY_CHECK_COUNT       10
 
+#define SENSE_BUFF_LEN  32
+
 /*
  * Mechanism to track CLARiiON inactive snapshot LUs.
  * This is done so that we can fail passive paths
libmultipath/checkers/libsg.c deleted +0 -94

94 lines not on this page · raw message

libmultipath/checkers/libsg.h deleted +0 -9
deleted file mode 100644
index 3994f45..0000000
@@ -1,9 +0,0 @@
-#ifndef _LIBSG_H
-#define _LIBSG_H
-
-#define SENSE_BUFF_LEN 32
-
-int sg_read (int sg_fd, unsigned char * buff, int buff_len,
-	     unsigned char * sense, int sense_len, unsigned int timeout);
-
-#endif /* _LIBSG_H */
libmultipath/checkers/ping.c new file +453 -0

453 lines not on this page · raw message

libmultipath/checkers/readsector0.c +3 -1
index 8fccb46..e485810 100644
@@ -4,11 +4,13 @@
 #include <stdio.h>
 
 #include "checkers.h"
-#include "libsg.h"
+#include "../libmultipath/libsg.h"
 
 #define MSG_READSECTOR0_UP	"readsector0 checker reports path is up"
 #define MSG_READSECTOR0_DOWN	"readsector0 checker reports path is down"
 
+#define SENSE_BUFF_LEN 32
+
 struct readsector0_checker_context {
 	void * dummy;
 };
libmultipath/checkers/tur.c deleted +0 -427

427 lines not on this page · raw message

libmultipath/checkers/tur.h deleted +0 -8
deleted file mode 100644
index a2e8c88..0000000
@@ -1,8 +0,0 @@
-#ifndef _TUR_H
-#define _TUR_H
-
-int tur (struct checker *);
-int tur_init (struct checker *);
-void tur_free (struct checker *);
-
-#endif /* _TUR_H */
libmultipath/defaults.h +1 -1
index db2b756..9a65cec 100644
@@ -32,7 +32,7 @@
 #define DEFAULT_UEV_WAIT_TIMEOUT 30
 #define DEFAULT_PRIO		PRIO_CONST
 #define DEFAULT_PRIO_ARGS	""
-#define DEFAULT_CHECKER		TUR
+#define DEFAULT_CHECKER		PING
 #define DEFAULT_FLUSH		FLUSH_DISABLED
 #define DEFAULT_USER_FRIENDLY_NAMES USER_FRIENDLY_NAMES_OFF
 #define DEFAULT_FORCE_SYNC	0
libmultipath/discovery.c +1 -0
index 663c8ea..bae5d24 100644
@@ -1539,6 +1539,7 @@ get_state (struct path * pp, struct config *conf, int daemon)
 			return PATH_UNCHECKED;
 		}
 		checker_set_fd(c, pp->fd);
+               checker_set_dev(c, pp->dev);
 		if (checker_init(c, pp->mpp?&pp->mpp->mpcontext:NULL)) {
 			memset(c, 0x0, sizeof(struct checker));
 			condlog(3, "%s: checker init failed", pp->dev);
libmultipath/hwtable.c +1 -1
index 390d143..9e8e9e3 100644
@@ -1081,7 +1081,7 @@ static struct hwentry default_hw[] = {
 		.pgpolicy      = FAILOVER,
 		.uid_attribute = "ID_SERIAL",
 		.selector      = "service-time 0",
-		.checker_name  = TUR,
+		.checker_name  = PING,
 		.alias_prefix  = "mpath",
 		.features      = "0",
 		.hwhandler     = "0",
libmultipath/libnvme.c new file +130 -0

130 lines not on this page · raw message

libmultipath/libnvme.h new file +10 -0
new file mode 100644
index 0000000..a2b5460
@@ -0,0 +1,10 @@
+#ifndef _LIBNVME_H
+#define _LIBNVME_H
+
+#include <linux/types.h>
+
+int nvme_read(int fd, __u64 slba, __u16 nblocks, __u16 control, __u32 dsmgmt,
+            __u32 reftag, __u16 apptag, __u16 appmask, void *data, void *metadata);
+int nvme_keep_alive(int fd, __u32 timeout_ms);
+
+#endif /* _LIBNVME_H */
libmultipath/libsg.c new file +113 -0

113 lines not on this page · raw message

libmultipath/libsg.h new file +13 -0
new file mode 100644
index 0000000..70049a2
@@ -0,0 +1,13 @@
+#ifndef _LIBSG_H
+#define _LIBSG_H
+
+#include "sg_include.h"
+
+#define TUR_CMD_LEN 6
+
+int sg_read (int sg_fd, unsigned char * buff, int buff_len,
+	     unsigned char * sense, int sense_len, unsigned int timeout);
+int sg_tur(int fd, struct sg_io_hdr *io_hdr, unsigned char *sense,
+        int sense_len, unsigned int timeout);
+
+#endif /* _LIBSG_H */
libmultipath/prioritizers/Makefile +1 -1
index 0c71e63..0c5c69b 100644
@@ -26,7 +26,7 @@ all: $(LIBS)
 libprioalua.so: alua.o alua_rtpg.o
 	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^
 
-libpriopath_latency.so: path_latency.o  ../checkers/libsg.o
+libpriopath_latency.so: path_latency.o  ../libsg.o ../libnvme.o
 	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -lm
 
 libprio%.so: %.o
libmultipath/prioritizers/path_latency.c +7 -51

95 lines not on this page · raw message

libmultipath/propsel.c +1 -1
index 27f3951..d4c24de 100644
@@ -316,7 +316,7 @@ int select_checker(struct config *conf, struct path *pp)
 	struct checker * c = &pp->checker;
 
 	if (pp->detect_checker == DETECT_CHECKER_ON && pp->tpgs > 0) {
-		checker_name = TUR;
+		checker_name = PING;
 		origin = "(setting: array autodetected)";
 		goto out;
 	}
multipath/multipath.conf.5 +2 -2
index 0049cba..915cc50 100644
@@ -418,8 +418,8 @@ are:
 (Deprecated) Read the first sector of the device. This checker is being
 deprecated, please use \fItur\fR instead.
 .TP
-.I tur
-Issue a \fITEST UNIT READY\fR command to the device.
+.I ping
+Issue a \fITEST UNIT READY\fR command or a \fIKEEP ALIVE\fR command to the device.
 .TP
 .I emc_clariion
 (Hardware-dependent)
Signature · 1 line
2.6.4.windows.1
author
#2 lore raw

PATCH 2/2 multipath-tools/libmultipath: Add args min_avg_latency for path_latency.

In reply to Yang Feng

Add args min_avg_latency of logarithmic scale, for prioritizers/path_latency.c.
Min average latency is not constant 1us, and is set by user. Certainly, max average latency value is still 100s. It make support better for more scenes, because it can deal better with the normal standard deviation of path latency. For example, when the standard deviation value is 200us and the average latency of the normal paths is 1ms, args base_num can be set to 5 and args min_avg_latency can be set to 2ms, so the paths will be grouped in priority groups with path latency <=2ms, (2ms, 10ms], (10ms, 50ms], etc.

---
 libmultipath/prioritizers/path_latency.c | 61 ++++++++++++++++++++++----------
 multipath/multipath.conf.5               | 14 +++++---
 2 files changed, 52 insertions(+), 23 deletions(-)
libmultipath/prioritizers/path_latency.c +42 -19
index 21209ff..c8fe318 100644
@@ -76,7 +76,7 @@ static int do_readsector0(struct path *pp, unsigned int timeout)
     return 1;
 }
 
-int check_args_valid(int io_num, int base_num)
+int check_args_valid(int io_num, int base_num, int min_avg_latency)
 {
     if ((io_num < MIN_IO_NUM) || (io_num > MAX_IO_NUM))
     {
@@ -90,24 +90,33 @@ int check_args_valid(int io_num, int base_num)
         return 0;
     }
 
+    if ((min_avg_latency < MIN_AVG_LATENCY) || (min_avg_latency > MAX_AVG_LATENCY))
+    {
+        pp_pl_log(0, "args min_avg_latency is outside the valid range");
+        return 0;
+    }
+
     return 1;
 }
 
-/* In multipath.conf, args form: io_num|base_num. For example,
-*  args is "20|10", this function can get io_num value 20, and
-   base_num value 10.
+/* In multipath.conf, args form: io_num|base_num|min_avg_latency.
+*  For example, args is "20|10|1", this function can get io_num
+*  value 20, base_num value 10, min_avg_latency value 1 (us).
 */
-static int get_ionum_and_basenum(char *args,
-                                 int *ionum,
-                                 int *basenum)
+static int get_prio_args(char *args,
+                    int *ionum,
+                    int *basenum,
+                    int *minavglatency)
 {
     char source[MAX_CHAR_SIZE];
     char vertica = '|';
-    char *endstrbefore = NULL;
-    char *endstrafter = NULL;
+    char *endstr1 = NULL;
+    char *endstr2 = NULL;
+    char *endstr3 = NULL;
     unsigned int size = strlen(args);
 
-    if ((args == NULL) || (ionum == NULL) || (basenum == NULL))
+    if ((args == NULL) || (ionum == NULL)
+        || (basenum == NULL) || (minavglatency == NULL))
     {
         pp_pl_log(0, "args string is NULL");
         return 0;
@@ -127,21 +136,34 @@ static int get_ionum_and_basenum(char *args,
         return 0;
     }
 
-    *ionum = (int)strtoul(source, &endstrbefore, 10);
-    if (endstrbefore[0] != vertica)
+    *ionum = (int)strtoul(source, &endstr1, 10);
+    if (endstr1[0] != vertica)
+    {
+        pp_pl_log(0, "invalid prio_args format: %s", source);
+        return 0;
+    }
+
+    if (!isdigit(endstr1[1]))
+    {
+        pp_pl_log(0, "invalid prio_args format: %s", source);
+        return 0;
+    }
+
+    *basenum = (long long)strtol(&endstr1[1], &endstr2, 10);
+    if (endstr2[0] != vertica)
     {
         pp_pl_log(0, "invalid prio_args format: %s", source);
         return 0;
     }
 
-    if (!isdigit(endstrbefore[1]))
+    if (!isdigit(endstr2[1]))
     {
         pp_pl_log(0, "invalid prio_args format: %s", source);
         return 0;
     }
 
-    *basenum = (long long)strtol(&endstrbefore[1], &endstrafter, 10);
-    if (check_args_valid(*ionum, *basenum) == 0)
+    *minavglatency = (long long)strtol(&endstr2[1], &endstr3, 10);
+    if (check_args_valid(*ionum, *basenum, *minavglatency) == 0)
     {
         return 0;
     }
@@ -204,6 +226,7 @@ int getprio (struct path *pp, char *args, unsigned int timeout)
     int index = 0;
     int io_num;
     int base_num;
+    int min_avg_latency;
     long long avglatency;
     long long latency_interval;
     long long standard_deviation;
@@ -214,7 +237,7 @@ int getprio (struct path *pp, char *args, unsigned int timeout)
     if (pp->fd < 0)
         return -1;
 
-    if (get_ionum_and_basenum(args, &io_num, &base_num) == 0)
+    if (get_prio_args(args, &io_num, &base_num, &min_avg_latency) == 0)
     {
         pp_pl_log(0, "%s: get path_latency args fail", pp->dev);
         return DEFAULT_PRIORITY;
@@ -255,13 +278,13 @@ int getprio (struct path *pp, char *args, unsigned int timeout)
     set can change latency_interval value corresponding to avglatency and is not constant.
     Warn the user if latency_interval is smaller than (2 * standard_deviation), or equal */
     standard_deviation = calc_standard_deviation(path_latency, index, avglatency);
-    latency_interval = calc_latency_interval(avglatency, MAX_AVG_LATENCY, MIN_AVG_LATENCY, base_num);
-    if ((latency_interval!= 0)
+    latency_interval = calc_latency_interval(avglatency, MAX_AVG_LATENCY, min_avg_latency, base_num);
+    if ((latency_interval != 0)
         && (latency_interval <= (2 * standard_deviation)))
         pp_pl_log(3, "%s: latency interval (%lld) according to average latency (%lld us) is smaller than "
             "2 * standard deviation (%lld us), or equal, args base_num (%d) needs to be set bigger value",
             pp->dev, latency_interval, avglatency, standard_deviation, base_num);
 
-    rc = calcPrio(avglatency, MAX_AVG_LATENCY, MIN_AVG_LATENCY, base_num);
+    rc = calcPrio(avglatency, MAX_AVG_LATENCY, min_avg_latency, base_num);
     return rc;
 }
multipath/multipath.conf.5 +10 -4
index 915cc50..e3fb461 100644
@@ -341,7 +341,7 @@ these values can be looked up through sysfs or by running \fImultipathd show pat
 .TP 12
 .I path_latency
 Needs a value of the form
-\fI"<io_num>|<base_num>"\fR
+\fI"<io_num>|<base_num>|<min_avg_latency>"\fR
 .RS
 .TP 8
 .I io_num
@@ -350,9 +350,15 @@ Valid Values: Integer, [2, 200].
 .TP
 .I base_num
 The base number value of logarithmic scale, used to partition different priority ranks. Valid Values: Integer,
-[2, 10]. And Max average latency value is 100s, min average latency value is 1us.
-For example: If base_num=10, the paths will be grouped in priority groups with path latency <=1us, (1us, 10us],
-(10us, 100us], (100us, 1ms], (1ms, 10ms], (10ms, 100ms], (100ms, 1s], (1s, 10s], (10s, 100s], >100s.
+[2, 10]. And Max average latency value is constant 100s.
+For example: If base_num=10 and min_avg_latency=1, the paths will be grouped in priority groups with path latency <=1us,
+(1us, 10us], (10us, 100us], (100us, 1ms], (1ms, 10ms], (10ms, 100ms], (100ms, 1s], (1s, 10s], (10s, 100s], >100s.
+.TP
+.I min_avg_latency
+The min average latency value of logarithmic scale, used to partition different priority ranks. Valid Values:
+Integer, [1, 10000000] (us). And  Max average latency value is constant 100s.
+For example: If base_num=10 and min_avg_latency=1000, the paths will be grouped in priority groups with path latency <=1ms,
+(1ms, 10ms], (10ms, 100ms], (100ms, 1s], (1s, 10s], (10s, 100s], >100s.
 .RE
 .TP 12
 .I alua
Signature · 1 line
2.6.4.windows.1
#3 lore raw
In reply to Yang Feng
Quoted 7 lines · Yang Feng

[...]
In the checkers, delete the file tur.c and create the new file ping.c:
ping.c can support the native NVMe Keep Alive Ioctl command to the nvme device, and can support the SG TUR Ioctl command to the scsi device. [...]

 delete mode 100644 libmultipath/checkers/tur.c
 delete mode 100644 libmultipath/checkers/tur.h

tur can not be deleted. It breaks current configs, and replacing the default checker so fast is a bit delicate.

author
#4 lore raw

Hi Xose,

But tur can not support NVMe device, and if the default checker change to ping, then it can support NVMe device by a keep alive command and SCSI device by a tur command.

Regards!
-Yang

Quoted 15 lines · Xose Vazquez Perez
Quoted 7 lines · Yang Feng

[...]
In the checkers, delete the file tur.c and create the new file ping.c:
ping.c can support the native NVMe Keep Alive Ioctl command to the nvme device, and can support the SG TUR Ioctl command to the scsi device. [...]

 delete mode 100644 libmultipath/checkers/tur.c
 delete mode 100644 libmultipath/checkers/tur.h

tur can not be deleted. It breaks current configs, and replacing the default checker so fast is a bit delicate.

.

#5 lore raw
Quoted 7 lines · Yang Feng

Hi Xose,

But tur can not support NVMe device, and if the default checker change to ping,
then it can support NVMe device by a keep alive command and SCSI device by a
tur command.

I agree with Xose. This is what we have the hwtable for. It's a good and necessary thing to implement a checker equivalent to TUR for NVME, but not a reason to remove TUR. SCSI is going to stay for some time to come.

As for the path latency checker and your readsector0 function, I don't quite understand why you are using SG_IO at all. Why can't you just read() with O_DIRECT?

Saying that without having had the time for a deeper review of your patch.

Martin

Signature · 8 lines
Dr. Martin Wilck <[email protected]>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
author
#6 lore raw

Hi Martin,

Thanks for your reviews.

I think there is a mistake:
1. In fact, the tur checker feature has never been removed. The tur checker has just been renamed to "ping" checker and the keep alive command checker feature is added into this checker. So, the renamed checker remains "tur" and add "keep alive". Absolutely, I agree that SCSI is going to stay for some time to come, So it can support a SCSI device by "tur" and support a NVMe device by "keep alive".
2. If add a new checker for "keep alive", it maybe increase the redundancy of code. And, when the SCSI LUN and the NVMe namespace are maped in the same array for the same host, no matter which checker is choosed, it will not be able to support the scenario very well.
3. Using read() with O_DIRECT for path_latency can avoid this problem, but can not fix this problem.

Respect and regards.
-Yang

Quoted 23 lines · Martin Wilck
Quoted 7 lines · Yang Feng

Hi Xose,

But tur can not support NVMe device, and if the default checker change to ping,
then it can support NVMe device by a keep alive command and SCSI device by a
tur command.

I agree with Xose. This is what we have the hwtable for. It's a good and necessary thing to implement a checker equivalent to TUR for NVME, but not a reason to remove TUR. SCSI is going to stay for some time to come.

As for the path latency checker and your readsector0 function, I don't quite understand why you are using SG_IO at all. Why can't you just read() with O_DIRECT?

Saying that without having had the time for a deeper review of your patch.

Martin

#7 lore raw
Quoted 5 lines · Yang Feng

I think there is a mistake:
1. In fact, the tur checker feature has never been removed. The tur checker has just been renamed to "ping" checker and the keep alive command checker feature is added into this checker. So, the renamed checker remains "tur" and add "keep alive". Absolutely, I agree that SCSI is going to stay for

Quoted 8 lines

some time to come, So it can support a SCSI device by "tur" and support a NVMe device by "keep alive".
2. If add a new checker for "keep alive", it maybe increase the redundancy of code. And, when the SCSI LUN and the NVMe namespace are maped in the same array for the same host, no matter which checker is choosed, it will not be able to support the scenario very well.
3. Using read() with O_DIRECT for path_latency can avoid this problem, but can not fix this problem.

There is no need to rename tur to ping. Same work can be done over tur.c.

author
#8 lore raw

Hi Xose,

Thanks for your reviews

The up-to-date patch will be sent later.

Regards!
-Yang

Quoted 18 lines · Xose Vazquez Perez
Quoted 5 lines · Yang Feng

I think there is a mistake:
1. In fact, the tur checker feature has never been removed. The tur checker has just been renamed to "ping" checker and the keep alive command checker feature is added into this checker. So, the renamed checker remains "tur" and add "keep alive". Absolutely, I agree that SCSI is going to stay for

Quoted 8 lines

some time to come, So it can support a SCSI device by "tur" and support a NVMe device by "keep alive".
2. If add a new checker for "keep alive", it maybe increase the redundancy of code. And, when the SCSI LUN and the NVMe namespace are maped in the same array for the same host, no matter which checker is choosed, it will not be able to support the scenario very well.
3. Using read() with O_DIRECT for path_latency can avoid this problem, but can not fix this problem.

There is no need to rename tur to ping. Same work can be done over tur.c.