Skip to contentSkip to conversation

add dm-hp-sw hw handler

PATCH In review Mike Christie 5 participants 9 messages Sep 30, 2005 – Oct 1, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/4 add dm-hp-sw hw handler

This the basic handler but cleaned up. HP pointed me to some qlogic code I can use to get more info so I hope to integrate some of that code when I get a chance.

drivers/md/dm-hp-sw.c +108 -0
diff -Naurp linux-2.6.14-rc2/drivers/md/dm-hp-sw.c linux-2.6.14-rc2.work/drivers/md/dm-hp-sw.c
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2005 Mike Christie, All rights reserved.
+ *
+ * This file is released under the GPL.
+ *
+ * Basic, very basic, support for HP StorageWorks and FSC FibreCat
+ */
+#include <scsi/scsi.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_dbg.h>
+
+#include "dm.h"
+#include "dm-hw-handler.h"
+
+static unsigned emc_rq_error(struct path *path, int result,
+			     struct scsi_sense_hdr *sense)
+{
+	DMINFO("hp_sw: hp_sw_endio 0x%x", result);
+	/*
+	 * TODO: get info from qlogic failover driver and
+	 * eval sense/ASC/ASCQ
+	 */
+	/*
+	 * just return true and send down the IO to see
+	 * if it worked for now
+	 */
+	if (scsi_sense_valid(sense))
+		scsi_print_sense_hdr("dm-hp-sw", sense);
+	return 0;
+}
+
+static void hp_sw_pg_init(struct hw_handler *hwh, unsigned bypassed,
+			   struct path *path)
+{
+	unsigned char cmd[MAX_COMMAND_SIZE];
+
+	memset(cmd, 0, MAX_COMMAND_SIZE);
+	cmd[0] = START_STOP;
+	/* Start spin cycle */
+	cmd[4] = 1;
+
+	DMINFO("hp_sw: queueing START_STOP command on %s",
+		path->dev->name);
+
+	if (dm_scsi_execute_rq(hwh, path, cmd, DMA_NONE, NULL, 0, 60 * HZ,
+			       __GFP_WAIT))
+		dm_pg_init_complete(path, MP_FAIL_PATH);
+}
+
+/*
+ * Placeholders for coming code
+ */
+static int hp_sw_create(struct hw_handler *hwh, unsigned argc, char **argv)
+{
+	int err;
+
+	err = dm_scsi_init_context_pool(hwh);
+	if (err) {
+		DMERR("hp_sw: could not setup context pool");
+		return err;
+	}
+	return 0;
+}
+
+static void hp_sw_destroy(struct hw_handler *hwh)
+{
+	dm_scsi_destroy_context_pool(hwh);
+}
+
+static struct hw_handler_type hp_sw_hwh = {
+	.name = "hp_sw",
+	.module = THIS_MODULE,
+	.create = hp_sw_create,
+	.destroy = hp_sw_destroy,
+	.pg_init = hp_sw_pg_init,
+	.rq_error = emc_rq_error,
+};
+
+static int __init hp_sw_init(void)
+{
+	int r;
+
+	r = dm_register_hw_handler(&hp_sw_hwh);
+	if (r < 0)
+		DMERR("hp_sw: register failed %d", r);
+
+	DMINFO("hp_sw version 0.4 loaded");
+
+	return r;
+}
+
+static void __exit hp_sw_exit(void)
+{
+	int r;
+
+	r = dm_unregister_hw_handler(&hp_sw_hwh);
+	if (r < 0)
+		DMERR("hp_sw: unregister failed %d", r);
+}
+
+module_init(hp_sw_init);
+module_exit(hp_sw_exit);
+
+MODULE_DESCRIPTION("HP StorageWorks and FSC FibreCat support for dm-multipath");
+MODULE_AUTHOR("Mike Christie <[email protected]>");
+MODULE_LICENSE("GPL");
drivers/md/Kconfig +5 -0
diff -Naurp linux-2.6.14-rc2/drivers/md/Kconfig linux-2.6.14-rc2.work/drivers/md/Kconfig
@@ -236,5 +236,10 @@ config DM_MULTIPATH_EMC
 	---help---
 	  Multipath support for EMC CX/AX series hardware.
 
+config DM_MULTIPATH_HP_SW
+	tristate "HP StorageWorks and FSC FibreCat support"
+	depends on DM_MULTIPATH && BLK_DEV_DM && EXPERIMENTAL
+	---help---
+	  HP StorageWorks and FSC FibreCat support for dm-multipath.
 endmenu
 
drivers/md/Makefile +1 -0
diff -Naurp linux-2.6.14-rc2/drivers/md/Makefile linux-2.6.14-rc2.work/drivers/md/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_BLK_DEV_DM)	+= dm-mod.o
 obj-$(CONFIG_DM_CRYPT)		+= dm-crypt.o
 obj-$(CONFIG_DM_MULTIPATH)	+= dm-multipath.o dm-round-robin.o
 obj-$(CONFIG_DM_MULTIPATH_EMC)	+= dm-emc.o
+obj-$(CONFIG_DM_MULTIPATH_HP_SW) += dm-hp-sw.o
 obj-$(CONFIG_DM_SNAPSHOT)	+= dm-snapshot.o
 obj-$(CONFIG_DM_MIRROR)		+= dm-mirror.o
 obj-$(CONFIG_DM_ZERO)		+= dm-zero.o
#1 lore raw

Hey Mike -

Is this for HP active/passive support? Thanks.

- Rob

Quoted 151 lines · Mike Christie

This the basic handler but cleaned up. HP pointed me to some qlogic code I can use to get more info so I hope to integrate some of that code when I get a chance.

diff -Naurp linux-2.6.14-rc2/drivers/md/dm-hp-sw.c linux-2.6.14-rc2.work/drivers/md/dm-hp-sw.c

drivers/md/dm-hp-sw.c +108 -0
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2005 Mike Christie, All rights reserved.
+ *
+ * This file is released under the GPL.
+ *
+ * Basic, very basic, support for HP StorageWorks and FSC FibreCat
+ */
+#include <scsi/scsi.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_dbg.h>
+
+#include "dm.h"
+#include "dm-hw-handler.h"
+
+static unsigned emc_rq_error(struct path *path, int result,
+			     struct scsi_sense_hdr *sense)
+{
+	DMINFO("hp_sw: hp_sw_endio 0x%x", result);
+	/*
+	 * TODO: get info from qlogic failover driver and
+	 * eval sense/ASC/ASCQ
+	 */
+	/*
+	 * just return true and send down the IO to see
+	 * if it worked for now
+	 */
+	if (scsi_sense_valid(sense))
+		scsi_print_sense_hdr("dm-hp-sw", sense);
+	return 0;
+}
+
+static void hp_sw_pg_init(struct hw_handler *hwh, unsigned bypassed,
+			   struct path *path)
+{
+	unsigned char cmd[MAX_COMMAND_SIZE];
+
+	memset(cmd, 0, MAX_COMMAND_SIZE);
+	cmd[0] = START_STOP;
+	/* Start spin cycle */
+	cmd[4] = 1;
+
+	DMINFO("hp_sw: queueing START_STOP command on %s",
+		path->dev->name);
+
+	if (dm_scsi_execute_rq(hwh, path, cmd, DMA_NONE, NULL, 0, 60 * HZ,
+			       __GFP_WAIT))
+		dm_pg_init_complete(path, MP_FAIL_PATH);
+}
+
+/*
+ * Placeholders for coming code
+ */
+static int hp_sw_create(struct hw_handler *hwh, unsigned argc, char **argv)
+{
+	int err;
+
+	err = dm_scsi_init_context_pool(hwh);
+	if (err) {
+		DMERR("hp_sw: could not setup context pool");
+		return err;
+	}
+	return 0;
+}
+
+static void hp_sw_destroy(struct hw_handler *hwh)
+{
+	dm_scsi_destroy_context_pool(hwh);
+}
+
+static struct hw_handler_type hp_sw_hwh = {
+	.name = "hp_sw",
+	.module = THIS_MODULE,
+	.create = hp_sw_create,
+	.destroy = hp_sw_destroy,
+	.pg_init = hp_sw_pg_init,
+	.rq_error = emc_rq_error,
+};
+
+static int __init hp_sw_init(void)
+{
+	int r;
+
+	r = dm_register_hw_handler(&hp_sw_hwh);
+	if (r < 0)
+		DMERR("hp_sw: register failed %d", r);
+
+	DMINFO("hp_sw version 0.4 loaded");
+
+	return r;
+}
+
+static void __exit hp_sw_exit(void)
+{
+	int r;
+
+	r = dm_unregister_hw_handler(&hp_sw_hwh);
+	if (r < 0)
+		DMERR("hp_sw: unregister failed %d", r);
+}
+
+module_init(hp_sw_init);
+module_exit(hp_sw_exit);
+
+MODULE_DESCRIPTION("HP StorageWorks and FSC FibreCat support for dm-multipath");
+MODULE_AUTHOR("Mike Christie <[email protected]>");
+MODULE_LICENSE("GPL");

diff -Naurp linux-2.6.14-rc2/drivers/md/Kconfig linux-2.6.14-rc2.work/drivers/md/Kconfig

drivers/md/Kconfig +5 -0
@@ -236,5 +236,10 @@ config DM_MULTIPATH_EMC
 	---help---
 	  Multipath support for EMC CX/AX series hardware.
 
+config DM_MULTIPATH_HP_SW
+	tristate "HP StorageWorks and FSC FibreCat support"
+	depends on DM_MULTIPATH && BLK_DEV_DM && EXPERIMENTAL
+	---help---
+	  HP StorageWorks and FSC FibreCat support for dm-multipath.

endmenu

diff -Naurp linux-2.6.14-rc2/drivers/md/Makefile linux-2.6.14-rc2.work/drivers/md/Makefile

drivers/md/Makefile +0 -0
@@ -34,6 +34,7 @@ obj-$(CONFIG_BLK_DEV_DM)	+= dm-mod.o

obj-$(CONFIG_DM_CRYPT) += dm-crypt.o
obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o
obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o
+obj-$(CONFIG_DM_MULTIPATH_HP_SW) += dm-hp-sw.o
obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o
obj-$(CONFIG_DM_MIRROR) += dm-mirror.o
obj-$(CONFIG_DM_ZERO) += dm-zero.o

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Signature · 8 lines
Robert Kenna / Red Hat
Sr Product Mgr - Storage
10 Technology Park Drive
Westford, MA 01886
o: (978) 392-2410 (x22410)
f: (978) 392-1001
c: (978) 771-6314
[email protected]
#2 lore raw
Quoted 3 lines · Rob Kenna

Is this for HP active/passive support? Thanks.

It is : EMA8000, EMA12000, EVA3000, EVA5000 EVA4000 , 6000, 8000 don't need no hardware handler (afaik).

Regards,
cvaroqui

#8 lore raw
In reply to Rob Kenna
Quoted 4 lines · Rob Kenna

Hey Mike -

Is this for HP active/passive support? Thanks.

Right now, it is for active/passive when you require manual/explicit/some-magic-command/whatever-vendorX-calls-it failover/logical-unit-access. HP or Christophe can give details about the specific models.

I was not sure if these boxes do active/passive automaitc/implicit/whatever too. If so I guess we need some config code in the create function so I do not send the start stop for the automatic failover case. I have not gotton to look at the qlogic code, becuase I have been busy rediffing and testing other patches so I only know what I remember Christophe telling me :)

#3 lore raw
In reply to Christophe Varoqui
Quoted 8 lines · Christophe Varoqui
Quoted 2 lines · Rob Kenna

Is this for HP active/passive support? Thanks.

It is : EMA8000, EMA12000, EVA3000, EVA5000 EVA4000 , 6000, 8000 don't need no hardware handler (afaik).

How does that fit into the storage works (the sw in dm-hp-sw) naming. Should I rename the module and fix the Kconfig?

#4 lore raw
Quoted 6 lines · Mike Christie
Quoted 5 lines · Christophe Varoqui
Quoted 2 lines · Rob Kenna

Is this for HP active/passive support? Thanks.

Quoted 6 lines
Quoted 3 lines

It is : EMA8000, EMA12000, EVA3000, EVA5000 EVA4000 , 6000, 8000 don't need no hardware handler (afaik).

How does that fit into the storage works (the sw in dm-hp-sw) naming. Should I rename the module and fix the Kconfig?

dm-sstart :
dm-scsi-start :
- express the actual role of the handler
- does not discriminate other vendors like FSC using the same trick

dm-assym-hp-sw
- express clearly the product family

dm-assym-sworks
- does not use the "hp" branding
not so bad considering how many corps have controled StorageWorks (Digital, Compaq, HP, ...)

I let you decide ... I have no taste for those things, as Alasdair already noted with my pp_ prefixes :)

Regards,
cvaroqui

#6 lore raw
In reply to Christophe Varoqui
Quoted 5 lines · Christophe Varoqui
Quoted 3 lines · Rob Kenna

Is this for HP active/passive support? Thanks.

It is : EMA8000, EMA12000, EVA3000, EVA5000

I don't know about the EMAs but the EVA3000 and 5000 are active/passive
- I've got 4 inhouse and a 5th on the way.

Quoted 1 line

EVA4000 , 6000, 8000 don't need no hardware handler (afaik).

These are all active/active. I don't have any to play with yet - probably next year.

        .../Ed
Signature · 4 lines
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:[email protected]
Member #1, Red Hat Community Ambassador Program
#5 lore raw
In reply to Christophe Varoqui
Quoted 4 lines · Christophe Varoqui

dm-assym-sworks
- does not use the "hp" branding
not so bad considering how many corps have controled StorageWorks (Digital, Compaq, HP, ...)

To us old farts, it will forever be DEC.

McData's SANavigator nicely reports the WWN as being owned by Digital. As it should be :-)

Your naming convention is probably politically correct and as good as you can get these days I think.

        .../Ed
Signature · 4 lines
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:[email protected]
Member #1, Red Hat Community Ambassador Program
#7 lore raw
In reply to Ed Wilts
Quoted 6 lines

- I've got 4 inhouse and a 5th on the way.

Quoted 1 line

EVA4000 , 6000, 8000 don't need no hardware handler (afaik).

These are all active/active. I don't have any to play with yet - probably next year.

That isn't entirely true; although they are active/active, there is still a preferred LUN for each controller. (see bad ascii art)

SAN FABRIC

|                            |
|                            |

Controller1<--Internal bus-->Controller2
|
|
LUN

Read IO to controller1 goes direct to the LUN. Read IOs to controller2 cross an internal bus to controller1, which can limit performance.

However, if IO is going consistently to the non-preffered controller, the EVA will flip the lun over and make that controller the preffered controller.

The upshot was we found we got better, more consistent, performance when we used the group-by-serial rather than multibus path_grouping_policy for the EVA8000.

Allegedly, there is a way to find out which controller is the preffered one for each lun, but I don't know what it is.

Cheers,

Guy

Signature · 4 lines
Dr. Guy Coates,  Informatics System Group
The Wellcome Trust Sanger Institute, Hinxton, Cambridge, CB10 1HH, UK
Tel: +44 (0)1223 834244 x 6925
Fax: +44 (0)1223 494919