Skip to contentSkip to conversation

multipath-tools: avoid I/O during uevent processing

PATCH Superseded Martin Wilck 3 participants 14 messages Mar 15, 2019 – Mar 16, 2019 Device mapper

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover multipath-tools: avoid I/O during uevent processing

Hi Christophe, hi Ben,

the bulk of this series attempts to avoid unnecessary I/O for "multipath -u" calls from udev rules. I came up with it in a recent attempt to debug avoid "multipath -u" hangups during boot. I found that the detect_alua() call in the get_refwwid->pathinfo->scsi_ioctl_pathinfo call sequence would cause an sg ioctl to be sent for every "multipath -u" invocation. That's obvious nonsense, we don't need to detect ALUA capabilities to find out if a device is a potential multipath member.

So, rather than setting pp->tpgs in pathinfo, I resorted to a "lazy" approach where ALUA capabilities are probed when they are needed, no sooner. I also cleaned up the ALUA code a bit (still some more to go), and made it attempt to read INQUIRY data from sysfs (this is fine for the ALUA prioritizer - it only needs to bypass sysfs for the RTPG calls).

Martin Wilck (9):
libmultipath: add sysfs_get_inquiry()
libmultipath: alua: make API more consistent
libmultipath: alua: try to retrieve inquiry data from sysfs
libmultipath: constify sysfs_get_timeout()
libmultipath: detect_alua(): use system timeout
libmultipath: lazy tpgs probing
libmultipath: don't link alua_rtpg.o twice
libmultipath: check_rdac(): pre-check in hwtable
libmultipath: hwtable: add Lenovo DE series

 libmultipath/discovery.c              | 46 +++++++++++++++++++--------
 libmultipath/discovery.h              | 10 +++---
 libmultipath/hwtable.c                | 20 ++++++++++++
 libmultipath/prioritizers/Makefile    |  3 --
 libmultipath/prioritizers/alua.c      |  4 +--
 libmultipath/prioritizers/alua_rtpg.c | 45 ++++++++++++++++++++------
 libmultipath/prioritizers/alua_rtpg.h |  7 ++--
 libmultipath/propsel.c                | 31 ++++++++++++------
 multipathd/main.c                     |  7 ++--
 9 files changed, 126 insertions(+), 47 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/9 libmultipath: add sysfs_get_inquiry()

Provide a utility function to retrieve inquiry data from sysfs, like we do for VPDs.

---
 libmultipath/discovery.c | 23 ++++++++++++++++++-----
 libmultipath/discovery.h |  6 ++++--
 2 files changed, 22 insertions(+), 7 deletions(-)
libmultipath/discovery.c +18 -5
index 10bd8cd6..65d651d4 100644
@@ -218,12 +218,11 @@ declare_sysfs_get_str(vendor);
 declare_sysfs_get_str(model);
 declare_sysfs_get_str(rev);
 
-ssize_t
-sysfs_get_vpd (struct udev_device * udev, int pg,
-	       unsigned char * buff, size_t len)
+static ssize_t
+sysfs_get_binary (struct udev_device * udev, const char *attrname,
+		  unsigned char *buff, size_t len)
 {
 	ssize_t attr_len;
-	char attrname[9];
 	const char * devname;
 
 	if (!udev) {
@@ -232,7 +231,6 @@ sysfs_get_vpd (struct udev_device * udev, int pg,
 	}
 
 	devname = udev_device_get_sysname(udev);
-	sprintf(attrname, "vpd_pg%02x", pg);
 	attr_len = sysfs_bin_attr_get_value(udev, attrname, buff, len);
 	if (attr_len < 0) {
 		condlog(3, "%s: attribute %s not found in sysfs",
@@ -242,6 +240,21 @@ sysfs_get_vpd (struct udev_device * udev, int pg,
 	return attr_len;
 }
 
+ssize_t sysfs_get_vpd(struct udev_device * udev, unsigned char pg,
+		      unsigned char *buff, size_t len)
+{
+	char attrname[9];
+
+	snprintf(attrname, sizeof(attrname), "vpd_pg%02x", pg);
+	return sysfs_get_binary(udev, attrname, buff, len);
+}
+
+ssize_t sysfs_get_inquiry(struct udev_device * udev,
+			  unsigned char *buff, size_t len)
+{
+	return sysfs_get_binary(udev, "inquiry", buff, len);
+}
+
 int
 sysfs_get_timeout(struct path *pp, unsigned int *timeout)
 {
libmultipath/discovery.h +4 -2
index 9aacf75b..7cacbb6c 100644
@@ -48,8 +48,10 @@ int sysfs_get_host_pci_name(const struct path *pp, char *pci_name);
 int sysfs_get_iscsi_ip_address(const struct path *pp, char *ip_address);
 int sysfs_get_host_adapter_name(const struct path *pp,
 				char *adapter_name);
-ssize_t sysfs_get_vpd (struct udev_device * udev, int pg, unsigned char * buff,
-		       size_t len);
+ssize_t sysfs_get_vpd (struct udev_device *udev, unsigned char pg,
+		       unsigned char *buff, size_t len);
+ssize_t sysfs_get_inquiry(struct udev_device *udev,
+			  unsigned char *buff, size_t len);
 int sysfs_get_asymmetric_access_state(struct path *pp,
 				      char *buff, int buflen);
 int get_uid(struct path * pp, int path_state, struct udev_device *udev);
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/9 libmultipath: alua: make API more consistent

In reply to Martin Wilck

Let all alua functions take "const struct path *" as first argument.

---
 libmultipath/discovery.c              |  4 ++--
 libmultipath/prioritizers/alua.c      |  4 ++--
 libmultipath/prioritizers/alua_rtpg.c | 28 +++++++++++++++++----------
 libmultipath/prioritizers/alua_rtpg.h |  7 ++++---
 libmultipath/propsel.c                |  2 +-
 5 files changed, 27 insertions(+), 18 deletions(-)
libmultipath/discovery.c +2 -2
index 65d651d4..6b4a420b 100644
@@ -839,12 +839,12 @@ detect_alua(struct path * pp, struct config *conf)
 	int tpgs;
 	unsigned int timeout = conf->checker_timeout;
 
-	if ((tpgs = get_target_port_group_support(pp->fd, timeout)) <= 0) {
+	if ((tpgs = get_target_port_group_support(pp, timeout)) <= 0) {
 		pp->tpgs = TPGS_NONE;
 		return;
 	}
 	ret = get_target_port_group(pp, timeout);
-	if (ret < 0 || get_asymmetric_access_state(pp->fd, ret, timeout) < 0) {
+	if (ret < 0 || get_asymmetric_access_state(pp, ret, timeout) < 0) {
 		pp->tpgs = TPGS_NONE;
 		return;
 	}
libmultipath/prioritizers/alua.c +2 -2
index b24e2d48..0ab06e2b 100644
@@ -58,7 +58,7 @@ get_alua_info(struct path * pp, unsigned int timeout)
 
 	tpg = get_target_port_group(pp, timeout);
 	if (tpg < 0) {
-		rc = get_target_port_group_support(pp->fd, timeout);
+		rc = get_target_port_group_support(pp, timeout);
 		if (rc < 0)
 			return -ALUA_PRIO_TPGS_FAILED;
 		if (rc == TPGS_NONE)
@@ -66,7 +66,7 @@ get_alua_info(struct path * pp, unsigned int timeout)
 		return -ALUA_PRIO_RTPG_FAILED;
 	}
 	condlog(3, "%s: reported target port group is %i", pp->dev, tpg);
-	rc = get_asymmetric_access_state(pp->fd, tpg, timeout);
+	rc = get_asymmetric_access_state(pp, tpg, timeout);
 	if (rc < 0) {
 		condlog(2, "%s: get_asymmetric_access_state returned %d",
 			__func__, rc);
libmultipath/prioritizers/alua_rtpg.c +18 -10
index 811ce7a2..d9215a88 100644
@@ -135,9 +135,9 @@ scsi_error(struct sg_io_hdr *hdr, int opcode)
 /*
  * Helper function to setup and run a SCSI inquiry command.
  */
-int
-do_inquiry(int fd, int evpd, unsigned int codepage,
-	   void *resp, int resplen, unsigned int timeout)
+static int
+do_inquiry_sg(int fd, int evpd, unsigned int codepage,
+	      void *resp, int resplen, unsigned int timeout)
 {
 	struct inquiry_command	cmd;
 	struct sg_io_hdr	hdr;
@@ -185,18 +185,24 @@ retry:
 	return 0;
 }
 
+int do_inquiry(const struct path *pp, int evpd, unsigned int codepage,
+	       void *resp, int resplen, unsigned int timeout)
+{
+	return do_inquiry_sg(pp->fd, evpd, codepage, resp, resplen, timeout);
+}
+
 /*
  * This function returns the support for target port groups by evaluating the
  * data returned by the standard inquiry command.
  */
 int
-get_target_port_group_support(int fd, unsigned int timeout)
+get_target_port_group_support(const struct path *pp, unsigned int timeout)
 {
 	struct inquiry_data	inq;
 	int			rc;
 
 	memset((unsigned char *)&inq, 0, sizeof(inq));
-	rc = do_inquiry(fd, 0, 0x00, &inq, sizeof(inq), timeout);
+	rc = do_inquiry(pp, 0, 0x00, &inq, sizeof(inq), timeout);
 	if (!rc) {
 		rc = inquiry_data_get_tpgs(&inq);
 	}
@@ -205,7 +211,7 @@ get_target_port_group_support(int fd, unsigned int timeout)
 }
 
 static int
-get_sysfs_pg83(struct path *pp, unsigned char *buff, int buflen)
+get_sysfs_pg83(const struct path *pp, unsigned char *buff, int buflen)
 {
 	struct udev_device *parent = pp->udev;
 
@@ -224,7 +230,7 @@ get_sysfs_pg83(struct path *pp, unsigned char *buff, int buflen)
 }
 
 int
-get_target_port_group(struct path * pp, unsigned int timeout)
+get_target_port_group(const struct path * pp, unsigned int timeout)
 {
 	unsigned char		*buf;
 	struct vpd83_data *	vpd83;
@@ -245,7 +251,7 @@ get_target_port_group(struct path * pp, unsigned int timeout)
 	rc = get_sysfs_pg83(pp, buf, buflen);
 
 	if (rc < 0) {
-		rc = do_inquiry(pp->fd, 1, 0x83, buf, buflen, timeout);
+		rc = do_inquiry(pp, 1, 0x83, buf, buflen, timeout);
 		if (rc < 0)
 			goto out;
 
@@ -263,7 +269,7 @@ get_target_port_group(struct path * pp, unsigned int timeout)
 			}
 			buflen = scsi_buflen;
 			memset(buf, 0, buflen);
-			rc = do_inquiry(pp->fd, 1, 0x83, buf, buflen, timeout);
+			rc = do_inquiry(pp, 1, 0x83, buf, buflen, timeout);
 			if (rc < 0)
 				goto out;
 		}
@@ -341,7 +347,8 @@ retry:
 }
 
 int
-get_asymmetric_access_state(int fd, unsigned int tpg, unsigned int timeout)
+get_asymmetric_access_state(const struct path *pp, unsigned int tpg,
+			    unsigned int timeout)
 {
 	unsigned char		*buf;
 	struct rtpg_data *	tpgd;
@@ -349,6 +356,7 @@ get_asymmetric_access_state(int fd, unsigned int tpg, unsigned int timeout)
 	int			rc;
 	int			buflen;
 	uint64_t		scsi_buflen;
+	int fd = pp->fd;
 
 	buflen = 4096;
 	buf = (unsigned char *)malloc(buflen);
libmultipath/prioritizers/alua_rtpg.h +4 -3
index 35cffaf3..675709ff 100644
@@ -22,8 +22,9 @@
 #define RTPG_RTPG_FAILED			3
 #define RTPG_TPG_NOT_FOUND			4
 
-int get_target_port_group_support(int fd, unsigned int timeout);
-int get_target_port_group(struct path * pp, unsigned int timeout);
-int get_asymmetric_access_state(int fd, unsigned int tpg, unsigned int timeout);
+int get_target_port_group_support(const struct path *pp, unsigned int timeout);
+int get_target_port_group(const struct path *pp, unsigned int timeout);
+int get_asymmetric_access_state(const struct path *pp,
+				unsigned int tpg, unsigned int timeout);
 
 #endif /* __RTPG_H__ */
libmultipath/propsel.c +1 -1
index 98068f34..624dc6ef 100644
@@ -632,7 +632,7 @@ out:
 		unsigned int timeout = conf->checker_timeout;
 
 		if(!pp->tpgs &&
-		   (tpgs = get_target_port_group_support(pp->fd, timeout)) >= 0)
+		   (tpgs = get_target_port_group_support(pp, timeout)) >= 0)
 			pp->tpgs = tpgs;
 	}
 	condlog(3, "%s: prio = %s %s", pp->dev, prio_name(p), origin);
Signature · 1 line
2.21.0
#3 lore raw

PATCH 3/9 libmultipath: alua: try to retrieve inquiry data from sysfs

In reply to Martin Wilck

This can avoid IO while configuring the path prioritizer. The alua prioritizer avoids reading from sysfs for a reason (see commit 7e2f46d3), but this applies only to RTPG / STPG, not to INQUIRY calls.

Cc NetApp RDAC team <[email protected]>
Cc Hannes Reinecke <[email protected]>
---
 libmultipath/prioritizers/alua_rtpg.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
libmultipath/prioritizers/alua_rtpg.c +17 -0
index d9215a88..271a019d 100644
@@ -188,6 +188,23 @@ retry:
 int do_inquiry(const struct path *pp, int evpd, unsigned int codepage,
 	       void *resp, int resplen, unsigned int timeout)
 {
+	struct udev_device *ud;
+
+	ud = udev_device_get_parent_with_subsystem_devtype(pp->udev, "scsi",
+							   "scsi_device");
+	if (ud != NULL) {
+		int rc;
+
+		if (!evpd)
+			rc = sysfs_get_inquiry(ud, resp, resplen);
+		else
+			rc = sysfs_get_vpd(ud, codepage, resp, resplen);
+
+		if (rc >= 0) {
+			PRINT_HEX((unsigned char *) resp, resplen);
+			return 0;
+		}
+	}
 	return do_inquiry_sg(pp->fd, evpd, codepage, resp, resplen, timeout);
 }
 
Signature · 1 line
2.21.0
#4 lore raw

PATCH 4/9 libmultipath: constify sysfs_get_timeout()

In reply to Martin Wilck
---
 libmultipath/discovery.c | 2 +-
 libmultipath/discovery.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
libmultipath/discovery.c +1 -1
index 6b4a420b..270dedc9 100644
@@ -256,7 +256,7 @@ ssize_t sysfs_get_inquiry(struct udev_device * udev,
 }
 
 int
-sysfs_get_timeout(struct path *pp, unsigned int *timeout)
+sysfs_get_timeout(const struct path *pp, unsigned int *timeout)
 {
 	const char *attr = NULL;
 	const char *subsys;
libmultipath/discovery.h +1 -1
index 7cacbb6c..a9a28add 100644
@@ -43,7 +43,7 @@ int store_pathinfo (vector pathvec, struct config *conf,
 		    struct udev_device *udevice, int flag,
 		    struct path **pp_ptr);
 int sysfs_set_scsi_tmo (struct multipath *mpp, int checkint);
-int sysfs_get_timeout(struct path *pp, unsigned int *timeout);
+int sysfs_get_timeout(const struct path *pp, unsigned int *timeout);
 int sysfs_get_host_pci_name(const struct path *pp, char *pci_name);
 int sysfs_get_iscsi_ip_address(const struct path *pp, char *ip_address);
 int sysfs_get_host_adapter_name(const struct path *pp,
Signature · 1 line
2.21.0
#5 lore raw

PATCH 5/9 libmultipath: detect_alua(): use system timeout

In reply to Martin Wilck

This is not the path checker - we don't need to use the configured checker timeout here. This makes it possible to call this function without a current (struct config *).

---
 libmultipath/discovery.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
libmultipath/discovery.c +6 -3
index 270dedc9..b2a43e86 100644
@@ -833,11 +833,14 @@ get_serial (char * str, int maxlen, int fd)
 }
 
 static void
-detect_alua(struct path * pp, struct config *conf)
+detect_alua(struct path * pp)
 {
 	int ret;
 	int tpgs;
-	unsigned int timeout = conf->checker_timeout;
+	unsigned int timeout;
+
+	if (sysfs_get_timeout(pp, &timeout) <= 0)
+		timeout = DEF_TIMEOUT;
 
 	if ((tpgs = get_target_port_group_support(pp, timeout)) <= 0) {
 		pp->tpgs = TPGS_NONE;
@@ -1519,7 +1522,7 @@ scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask)
 	const char *attr_path = NULL;
 
 	if (pp->tpgs == TPGS_UNDEF)
-		detect_alua(pp, conf);
+		detect_alua(pp);
 
 	if (!(mask & DI_SERIAL))
 		return;
Signature · 1 line
2.21.0
#6 lore raw

PATCH 6/9 libmultipath: lazy tpgs probing

In reply to Martin Wilck

Provide a "getter" function that can be used to probe tpgs lazily. This way we don't need to send an RTPG in the pathinfo() call chain (e.g. in "multipath -u").

Moreover, in select_prio(), in the case where the alua checker was statically configured, rather then calling into the alua code directly, use get_tpgs(), which does all the proper error checking, and fall back to const if it fails.

---
 libmultipath/discovery.c | 10 +++++++---
 libmultipath/discovery.h |  2 +-
 libmultipath/propsel.c   | 23 ++++++++++++++---------
 multipathd/main.c        |  7 ++++---
 4 files changed, 26 insertions(+), 16 deletions(-)
libmultipath/discovery.c +7 -3
index b2a43e86..b51a37b2 100644
@@ -854,6 +854,13 @@ detect_alua(struct path * pp)
 	pp->tpgs = tpgs;
 }
 
+int path_get_tpgs(struct path *pp)
+{
+	if (pp->tpgs == TPGS_UNDEF)
+		detect_alua(pp);
+	return pp->tpgs;
+}
+
 #define DEFAULT_SGIO_LEN 254
 
 /* Query VPD page @pg. Returns number of INQUIRY bytes
@@ -1521,9 +1528,6 @@ scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask)
 	struct udev_device *parent;
 	const char *attr_path = NULL;
 
-	if (pp->tpgs == TPGS_UNDEF)
-		detect_alua(pp);
-
 	if (!(mask & DI_SERIAL))
 		return;
 
libmultipath/discovery.h +1 -1
index a9a28add..01789339 100644
@@ -31,7 +31,7 @@
 struct config;
 
 int path_discovery (vector pathvec, int flag);
-
+int path_get_tpgs(struct path *pp); /* This function never returns TPGS_UNDEF */
 int do_tur (char *);
 int path_offline (struct path *);
 int get_state (struct path * pp, struct config * conf, int daemon, int state);
libmultipath/propsel.c +14 -9
index 624dc6ef..d5fbd94e 100644
@@ -490,7 +490,7 @@ int select_checker(struct config *conf, struct path *pp)
 		if (check_rdac(pp)) {
 			ckr_name = RDAC;
 			goto out;
-		} else if (pp->tpgs > 0) {
+		} else if (path_get_tpgs(pp) != TPGS_NONE) {
 			ckr_name = TUR;
 			goto out;
 		}
@@ -552,6 +552,7 @@ detect_prio(struct config *conf, struct path * pp)
 	struct prio *p = &pp->prio;
 	char buff[512];
 	char *default_prio;
+	int tpgs;
 
 	switch(pp->bus) {
 	case SYSFS_BUS_NVME:
@@ -560,9 +561,10 @@ detect_prio(struct config *conf, struct path * pp)
 		default_prio = PRIO_ANA;
 		break;
 	case SYSFS_BUS_SCSI:
-		if (pp->tpgs <= 0)
+		tpgs = path_get_tpgs(pp);
+		if (tpgs == TPGS_NONE)
 			return;
-		if ((pp->tpgs == 2 || !check_rdac(pp)) &&
+		if ((tpgs == TPGS_EXPLICIT || !check_rdac(pp)) &&
 		    sysfs_get_asymmetric_access_state(pp, buff, 512) >= 0)
 			default_prio = PRIO_SYSFS;
 		else
@@ -607,6 +609,7 @@ int select_prio(struct config *conf, struct path *pp)
 	const char *origin;
 	struct mpentry * mpe;
 	struct prio * p = &pp->prio;
+	int log_prio = 3;
 
 	if (pp->detect_prio == DETECT_PRIO_ON) {
 		detect_prio(conf, pp);
@@ -628,14 +631,16 @@ out:
 	 * fetch tpgs mode for alua, if its not already obtained
 	 */
 	if (!strncmp(prio_name(p), PRIO_ALUA, PRIO_NAME_LEN)) {
-		int tpgs = 0;
-		unsigned int timeout = conf->checker_timeout;
+		int tpgs = path_get_tpgs(pp);
 
-		if(!pp->tpgs &&
-		   (tpgs = get_target_port_group_support(pp, timeout)) >= 0)
-			pp->tpgs = tpgs;
+		if (tpgs == TPGS_NONE) {
+			prio_get(conf->multipath_dir,
+				 p, DEFAULT_PRIO, DEFAULT_PRIO_ARGS);
+			origin = "(setting: emergency fallback - alua failed)";
+			log_prio = 1;
+		}
 	}
-	condlog(3, "%s: prio = %s %s", pp->dev, prio_name(p), origin);
+	condlog(log_prio, "%s: prio = %s %s", pp->dev, prio_name(p), origin);
 	condlog(3, "%s: prio args = \"%s\" %s", pp->dev, prio_args(p), origin);
 	return 0;
 }
multipathd/main.c +4 -3
index fb520b64..269a96ec 100644
@@ -936,7 +936,8 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map)
 	}
 	if (mpp && mpp->wait_for_udev &&
 	    (pathcount(mpp, PATH_UP) > 0 ||
-	     (pathcount(mpp, PATH_GHOST) > 0 && pp->tpgs != TPGS_IMPLICIT &&
+	     (pathcount(mpp, PATH_GHOST) > 0 &&
+	      path_get_tpgs(pp) != TPGS_IMPLICIT &&
 	      mpp->ghost_delay_tick <= 0))) {
 		/* if wait_for_udev is set and valid paths exist */
 		condlog(3, "%s: delaying path addition until %s is fully initialized",
@@ -2106,8 +2107,8 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
 	 * paths if there are no other active paths in map.
 	 */
 	disable_reinstate = (newstate == PATH_GHOST &&
-			    pp->mpp->nr_active == 0 &&
-			    pp->tpgs == TPGS_IMPLICIT) ? 1 : 0;
+			     pp->mpp->nr_active == 0 &&
+			     path_get_tpgs(pp) == TPGS_IMPLICIT) ? 1 : 0;
 
 	pp->chkrstate = newstate;
 	if (newstate != pp->state) {
Signature · 1 line
2.21.0
#7 lore raw

PATCH 7/9 libmultipath: don't link alua_rtpg.o twice

In reply to Martin Wilck

We link this already to libmultipath.so. Therefore, no need to link ti to libprioalua.so, too.

---
 libmultipath/prioritizers/Makefile | 3 ---
 1 file changed, 3 deletions(-)
libmultipath/prioritizers/Makefile +0 -3
index 4d80c20c..9d0fe03c 100644
@@ -28,9 +28,6 @@ endif
 
 all: $(LIBS)
 
-libprioalua.so: alua.o alua_rtpg.o
-	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^
-
 libpriopath_latency.so: path_latency.o  ../checkers/libsg.o
 	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -lm
 
Signature · 1 line
2.21.0
#8 lore raw

PATCH 8/9 libmultipath: check_rdac(): pre-check in hwtable

In reply to Martin Wilck

Currently check_rdac() always runs an SG_IO for VPD 0xc9 to check if the storage supports RDAC. This is an extra IO, and may cause annoying error messages on the storage side for non-RDAC arrays. Do the RDAC override only for arrays that have legacy configuration to use the rdac checker.

Cc NetApp RDAC team <[email protected]>
Cc Hannes Reinecke <[email protected]>
---
 libmultipath/propsel.c | 8 ++++++++
 1 file changed, 8 insertions(+)
libmultipath/propsel.c +8 -0
index d5fbd94e..2eb6fc2a 100644
@@ -470,9 +470,17 @@ check_rdac(struct path * pp)
 {
 	int len;
 	char buff[44];
+	const char *checker_name = NULL;
+	/* dummy, for do_set_from_hwe */
+	const char *origin __attribute__((unused));
 
 	if (pp->bus != SYSFS_BUS_SCSI)
 		return 0;
+	/* Avoid ioctl if this is likely not an RDAC array */
+	do_set_from_hwe(checker_name, pp, checker_name, NULL);
+out:    /* for do_set_from_hwe */
+	if (!checker_name || strcmp(checker_name, RDAC))
+		return 0;
 	len = get_vpd_sgio(pp->fd, 0xC9, buff, 44);
 	if (len <= 0)
 		return 0;
Signature · 1 line
2.21.0
#9 lore raw

PATCH 9/9 libmultipath: hwtable: add Lenovo DE series

In reply to Martin Wilck

I got this from Steven.

---
 libmultipath/hwtable.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
libmultipath/hwtable.c +20 -0
index d3a8d9ba..fd9afc75 100644
@@ -701,6 +701,26 @@ static struct hwentry default_hw[] = {
 		.no_path_retry = (300 / DEFAULT_CHECKINT),
 		.prio_name     = PRIO_ALUA,
 	},
+        /*
+         * Lenovo
+         */
+        {
+                /*
+		 * DE Series
+		 *
+		 * Maintainer: Steve Schremmer <[email protected]>
+		 */
+                .vendor        = "LENOVO",
+                .product       = "DE_Series",
+                .bl_product    = "Universal Xport",
+                .pgpolicy      = GROUP_BY_PRIO,
+                .checker_name  = RDAC,
+                .features      = "2 pg_init_retries 50",
+                .hwhandler     = "1 rdac",
+                .prio_name     = PRIO_RDAC,
+                .pgfailback    = -FAILBACK_IMMEDIATE,
+                .no_path_retry = 30,
+        },
 	/*
 	 * NetApp
 	 */
Signature · 1 line
2.21.0
#10 lore raw

Re: [PATCH 9/9] libmultipath: hwtable: add Lenovo DE series

Quoted 9 lines · Martin Wilck

I got this from Steven.

---
 libmultipath/hwtable.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Do not forget the kernel side:
drivers/scsi/{scsi_devinfo.c,scsi_dh.c}

Quoted 32 lines
libmultipath/hwtable.c +20 -0
index d3a8d9ba..fd9afc75 100644
@@ -701,6 +701,26 @@ static struct hwentry default_hw[] = {
 		.no_path_retry = (300 / DEFAULT_CHECKINT),
 		.prio_name     = PRIO_ALUA,
 	},
+        /*
+         * Lenovo
+         */
+        {
+                /*
+		 * DE Series
+		 *
+		 * Maintainer: Steve Schremmer <[email protected]>
+		 */
+                .vendor        = "LENOVO",
+                .product       = "DE_Series",
+                .bl_product    = "Universal Xport",
+                .pgpolicy      = GROUP_BY_PRIO,
+                .checker_name  = RDAC,
+                .features      = "2 pg_init_retries 50",
+                .hwhandler     = "1 rdac",
+                .prio_name     = PRIO_RDAC,
+                .pgfailback    = -FAILBACK_IMMEDIATE,
+                .no_path_retry = 30,
+        },
 	/*
 	 * NetApp
 	 */
#11 lore raw

Re: [PATCH 9/9] libmultipath: hwtable: add Lenovo DE series

In reply to Martin Wilck
Quoted 13 lines
libmultipath/hwtable.c +13 -0
+        /*
+         * Lenovo
+         */
+        {
+                /*
+                * DE Series
+                *
+                * Maintainer: Steve Schremmer <[email protected]>
+                */
+                .vendor        = "LENOVO",
+                .product       = "DE_Series",
+                .bl_product    = "Universal Xport",
+                .pgpolicy      = GROUP_BY_PRIO,

libmultipath/hwtable.c static struct hwentry default_hw[] = { · line 726

Quoted 10 lines
libmultipath/hwtable.c +7 -0
+                .checker_name  = RDAC,
+                .features      = "2 pg_init_retries 50",
+                .hwhandler     = "1 rdac",
+                .prio_name     = PRIO_RDAC,
+                .pgfailback    = -FAILBACK_IMMEDIATE,
+                .no_path_retry = 30,
+        },
        /*
         * NetApp
         */

If you're going to list a netapp.com address, may as well be [email protected]

#12 lore raw

Re: [PATCH 9/9] libmultipath: hwtable: add Lenovo DE series

Quoted 25 lines · Steven
Quoted 14 lines
libmultipath/hwtable.c +8 -0
+        /*
+         * Lenovo
+         */
+        {
+                /*
+                * DE Series
+                *
+                * Maintainer: Steve Schremmer <

[email protected]>

libmultipath/hwtable.c +5 -0
+                */
+                .vendor        = "LENOVO",
+                .product       = "DE_Series",
+                .bl_product    = "Universal Xport",
+                .pgpolicy      = GROUP_BY_PRIO,

libmultipath/hwtable.c static struct hwentry default_hw[] = { · line 726

Quoted 10 lines
libmultipath/hwtable.c +7 -0
+                .checker_name  = RDAC,
+                .features      = "2 pg_init_retries 50",
+                .hwhandler     = "1 rdac",
+                .prio_name     = PRIO_RDAC,
+                .pgfailback    = -FAILBACK_IMMEDIATE,
+                .no_path_retry = 30,
+        },
        /*
         * NetApp
         */
Quoted 3 lines

If you're going to list a netapp.com address, may as well be [email protected]

Currently, we have these in hwtable.c:

* Maintainer: Martin George <[email protected]>
* Maintainer: PJ Waskiewicz <[email protected]>

Should they all be replaced by the ng-eseries address?

Also, if you happen to know a Lenovo maintainer, feel free to tell me.

Martin

Signature · 9 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
#13 lore raw

Re: [PATCH 9/9] libmultipath: hwtable: add Lenovo DE series

Quoted 3 lines · Martin Wilck

Currently, we have these in hwtable.c:

* Maintainer: Martin George <[email protected]>

only for ONTAP.

Quoted 1 line

* Maintainer: PJ Waskiewicz <[email protected]>

and only for SolidFir.

Quoted 1 line

Should they all be replaced by the ng-eseries address?

No. ng-eseries address is just for RDAC devices.

Quoted 2 lines

Also, if you happen to know a Lenovo maintainer, feel free to tell me.

It could be deserted. There is no maintainer for all other rdac arrays. All of them share the same config, inherited from "SANtricity(RDAC) family".