All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
@ 2005-09-30 19:42 Mike Christie
  2005-09-30 20:44 ` Rob Kenna
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Christie @ 2005-09-30 19:42 UTC (permalink / raw)
  To: dm-devel

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.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

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
--- linux-2.6.14-rc2/drivers/md/dm-hp-sw.c	1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.14-rc2.work/drivers/md/dm-hp-sw.c	2005-09-30 14:12:58.000000000 -0500
@@ -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 <michaelc@cs.wisc.edu>");
+MODULE_LICENSE("GPL");
diff -Naurp linux-2.6.14-rc2/drivers/md/Kconfig linux-2.6.14-rc2.work/drivers/md/Kconfig
--- linux-2.6.14-rc2/drivers/md/Kconfig	2005-09-19 22:00:41.000000000 -0500
+++ linux-2.6.14-rc2.work/drivers/md/Kconfig	2005-09-30 00:05:37.000000000 -0500
@@ -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
--- linux-2.6.14-rc2/drivers/md/Makefile	2005-09-19 22:00:41.000000000 -0500
+++ linux-2.6.14-rc2.work/drivers/md/Makefile	2005-09-30 00:05:37.000000000 -0500
@@ -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

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 19:42 [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler Mike Christie
@ 2005-09-30 20:44 ` Rob Kenna
  2005-09-30 20:52   ` Christophe Varoqui
  2005-09-30 20:57   ` Mike Christie
  0 siblings, 2 replies; 9+ messages in thread
From: Rob Kenna @ 2005-09-30 20:44 UTC (permalink / raw)
  To: device-mapper development

Hey Mike -

Is this for HP active/passive support?  Thanks.

- Rob

Mike Christie wrote:

>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.
>
>Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>
>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
>--- linux-2.6.14-rc2/drivers/md/dm-hp-sw.c	1969-12-31 18:00:00.000000000 -0600
>+++ linux-2.6.14-rc2.work/drivers/md/dm-hp-sw.c	2005-09-30 14:12:58.000000000 -0500
>@@ -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 <michaelc@cs.wisc.edu>");
>+MODULE_LICENSE("GPL");
>diff -Naurp linux-2.6.14-rc2/drivers/md/Kconfig linux-2.6.14-rc2.work/drivers/md/Kconfig
>--- linux-2.6.14-rc2/drivers/md/Kconfig	2005-09-19 22:00:41.000000000 -0500
>+++ linux-2.6.14-rc2.work/drivers/md/Kconfig	2005-09-30 00:05:37.000000000 -0500
>@@ -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
>--- linux-2.6.14-rc2/drivers/md/Makefile	2005-09-19 22:00:41.000000000 -0500
>+++ linux-2.6.14-rc2.work/drivers/md/Makefile	2005-09-30 00:05:37.000000000 -0500
>@@ -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
>dm-devel@redhat.com
>https://www.redhat.com/mailman/listinfo/dm-devel
>  
>


-- 
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
rkenna@redhat.com

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 20:44 ` Rob Kenna
@ 2005-09-30 20:52   ` Christophe Varoqui
  2005-09-30 21:41     ` Mike Christie
  2005-09-30 23:04     ` Ed Wilts
  2005-09-30 20:57   ` Mike Christie
  1 sibling, 2 replies; 9+ messages in thread
From: Christophe Varoqui @ 2005-09-30 20:52 UTC (permalink / raw)
  To: rkenna, device-mapper development

On ven, 2005-09-30 at 16:44 -0400, Rob Kenna wrote:
> 
> 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

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 20:44 ` Rob Kenna
  2005-09-30 20:52   ` Christophe Varoqui
@ 2005-09-30 20:57   ` Mike Christie
  1 sibling, 0 replies; 9+ messages in thread
From: Mike Christie @ 2005-09-30 20:57 UTC (permalink / raw)
  To: rkenna, device-mapper development

Rob Kenna wrote:
> 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 :)

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 20:52   ` Christophe Varoqui
@ 2005-09-30 21:41     ` Mike Christie
  2005-09-30 22:01       ` Christophe Varoqui
  2005-09-30 23:04     ` Ed Wilts
  1 sibling, 1 reply; 9+ messages in thread
From: Mike Christie @ 2005-09-30 21:41 UTC (permalink / raw)
  To: christophe.varoqui, device-mapper development

Christophe Varoqui wrote:
> On ven, 2005-09-30 at 16:44 -0400, Rob Kenna wrote:
> 
>>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?

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 21:41     ` Mike Christie
@ 2005-09-30 22:01       ` Christophe Varoqui
  2005-09-30 23:07         ` Ed Wilts
  0 siblings, 1 reply; 9+ messages in thread
From: Christophe Varoqui @ 2005-09-30 22:01 UTC (permalink / raw)
  To: device-mapper development

On ven, 2005-09-30 at 16:41 -0500, Mike Christie wrote:
> Christophe Varoqui wrote:
> > On ven, 2005-09-30 at 16:44 -0400, Rob Kenna wrote:
> > 
> >>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?

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

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 20:52   ` Christophe Varoqui
  2005-09-30 21:41     ` Mike Christie
@ 2005-09-30 23:04     ` Ed Wilts
  2005-10-01  8:27       ` Guy Coates
  1 sibling, 1 reply; 9+ messages in thread
From: Ed Wilts @ 2005-09-30 23:04 UTC (permalink / raw)
  To: christophe.varoqui, device-mapper development

On Fri, Sep 30, 2005 at 10:52:03PM +0200, Christophe Varoqui wrote:
> On ven, 2005-09-30 at 16:44 -0400, Rob Kenna wrote:
> > 
> > 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.

> 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
-- 
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:ewilts@ewilts.org
Member #1, Red Hat Community Ambassador Program

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 22:01       ` Christophe Varoqui
@ 2005-09-30 23:07         ` Ed Wilts
  0 siblings, 0 replies; 9+ messages in thread
From: Ed Wilts @ 2005-09-30 23:07 UTC (permalink / raw)
  To: device-mapper development

On Sat, Oct 01, 2005 at 12:01:27AM +0200, Christophe Varoqui wrote:
> 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

-- 
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:ewilts@ewilts.org
Member #1, Red Hat Community Ambassador Program

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

* Re: [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler
  2005-09-30 23:04     ` Ed Wilts
@ 2005-10-01  8:27       ` Guy Coates
  0 siblings, 0 replies; 9+ messages in thread
From: Guy Coates @ 2005-10-01  8:27 UTC (permalink / raw)
  To: device-mapper development; +Cc: christophe.varoqui

> - I've got 4 inhouse and a 5th on the way.
>
> > 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



-- 
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

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

end of thread, other threads:[~2005-10-01  8:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-30 19:42 [PATCH RFT/RFC 4/4] add dm-hp-sw hw handler Mike Christie
2005-09-30 20:44 ` Rob Kenna
2005-09-30 20:52   ` Christophe Varoqui
2005-09-30 21:41     ` Mike Christie
2005-09-30 22:01       ` Christophe Varoqui
2005-09-30 23:07         ` Ed Wilts
2005-09-30 23:04     ` Ed Wilts
2005-10-01  8:27       ` Guy Coates
2005-09-30 20:57   ` Mike Christie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.