Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 155210 Details for
Bug 195685
RFE: Add dm-hp-sw to kernel to allow use of active/passive sans with dm multipathing
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Simpler patch against 2.6.22-rc1 (does not have retries or anything)
dm-hp-sw-v0.974.patch (text/plain), 7.60 KB, created by
Dave Wysochanski
on 2007-05-22 22:45:32 UTC
(
hide
)
Description:
Simpler patch against 2.6.22-rc1 (does not have retries or anything)
Filename:
MIME Type:
Creator:
Dave Wysochanski
Created:
2007-05-22 22:45:32 UTC
Size:
7.60 KB
patch
obsolete
>Index: linux-2.6.22-rc1/drivers/md/Makefile >=================================================================== >--- linux-2.6.22-rc1.orig/drivers/md/Makefile >+++ linux-2.6.22-rc1/drivers/md/Makefile >@@ -34,6 +34,7 @@ obj-$(CONFIG_DM_CRYPT) += dm-crypt.o > obj-$(CONFIG_DM_DELAY) += dm-delay.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) += 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 >Index: linux-2.6.22-rc1/drivers/md/dm-hp-sw.c >=================================================================== >--- /dev/null >+++ linux-2.6.22-rc1/drivers/md/dm-hp-sw.c >@@ -0,0 +1,230 @@ >+/* >+ * Copyright (C) 2005 Mike Christie, All rights reserved. >+ * Copyright (C) 2007 Red Hat, Inc. All rights reserved. >+ * Authors: Mike Christie >+ * Dave Wysochanski >+ * >+ * This file is released under the GPL. >+ * >+ * Basic support for HP StorageWorks and FSC FibreCat Asymmetric (Active/Passive) >+ * storage arrays. These storage arrays have controller-based failover, not >+ * LUN-based failover. This module is written for LUN-based failover. >+ * LUN-based failover is the design of dm-mp. >+ */ >+#include <scsi/scsi.h> >+#include <scsi/scsi_cmnd.h> >+#include <scsi/scsi_dbg.h> >+#include <scsi/scsi_device.h> >+#include <scsi/scsi_host.h> >+#include <scsi/scsi_transport_fc.h> >+#include <linux/list.h> >+#include <linux/types.h> >+ >+#include "dm.h" >+#include "dm-hw-handler.h" >+ >+#define DM_MSG_PREFIX "multipath hp" >+ >+/* >+ * A path activation command may take a longer time to complete. >+ * The time depends on the I/O load, the number of LUNs, etc. >+ * Set a miniumum of 30 seconds to allow path activation command >+ * completion. >+ */ >+#define MIN_CMD_TIMEOUT 30 >+static int hp_sw_cmd_timeout=MIN_CMD_TIMEOUT; >+module_param_named(cmd_timeout, hp_sw_cmd_timeout, int, S_IRUGO|S_IWUSR); >+MODULE_PARM_DESC(cmd_timeout, >+ "Time (in seconds) to wait for path activation " >+ "command completion. Set to a higher value when " >+ "there are many LUNs or the I/O load is high. "); >+/* >+ * Data specific to the HP hardware handler and path activation completion >+ */ >+struct hp_sw_context { >+ unsigned char sense[SCSI_SENSE_BUFFERSIZE]; >+}; >+ >+ >+/** >+ * hp_sw_end_io - Completion handler for HP path activation. >+ * @req: failover request >+ * @error: scsi-ml error >+ * >+ * Check sense data, free request structure, and notify dm that >+ * pg initialization has completed. >+ * >+ * Context: scsi-ml softirq >+ * TODO: add comment about locking. >+ */ >+static void hp_sw_end_io(struct request *req, int error) >+{ >+ struct dm_path *path = req->end_io_data; >+ unsigned err_flags; >+ >+ /* TODO: difference between 'error' arg and req->errors */ >+ if (error == 0) { >+ err_flags = 0; >+ /* XXX - Remove this log message? */ >+ DMINFO("hp_sw: START_STOP on %s completed successfully", >+ path->dev->name); >+ } >+ else { >+ /* FIXME: Error might be retryable */ >+ /* XXX - Remove this log message? */ >+ DMINFO("hp_sw: START_STOP on %s completed with error=0x%x", >+ path->dev->name, error); >+ DMINFO("hp_sw: %s pg_init fail", path->dev->name); >+ err_flags = MP_FAIL_PATH; >+ } >+ >+ req->end_io_data = NULL; >+ __blk_put_request(req->q, req); >+ dm_pg_init_complete(path, err_flags); >+} >+ >+/** >+ * hp_sw_get_request - Allocate an HP specific path activation request >+ * @path: path on which request will be sent (needed for request queue) >+ * >+ * The START command is used for path activation request. >+ * These arrays are controller-based failover, not LUN based. >+ * One START command issued to a single path will fail over all >+ * LUNs for the same controller. >+ */ >+static struct request *hp_sw_get_request(struct dm_path *path) >+{ >+ struct request *req=NULL; >+ struct block_device *bdev = path->dev->bdev; >+ struct request_queue *q = bdev_get_queue(bdev); >+ struct hp_sw_context *h = path->hwhcontext; >+ >+ req = blk_get_request(q, WRITE, GFP_ATOMIC); >+ if (req == NULL) >+ goto exit; >+ >+ req->timeout = hp_sw_cmd_timeout*HZ; >+ >+ req->errors = 0; >+ req->cmd_type = REQ_TYPE_BLOCK_PC; >+ req->cmd_flags |= REQ_FAILFAST | REQ_NOMERGE; >+ req->end_io = hp_sw_end_io; >+ req->end_io_data = path; >+ req->sense = h->sense; >+ memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE); >+ >+ memset(&req->cmd, 0, BLK_MAX_CDB); >+ req->cmd[0] = START_STOP; >+ req->cmd[4] = 1; >+ req->cmd_len = COMMAND_SIZE(req->cmd[0]); >+exit: >+ return req; >+} >+ >+/** >+ * hp_sw_pg_init - HP path activation implementation. >+ * @hwh: hardware handler specific data >+ * @bypassed: >+ * @path: path to send initialization command >+ * >+ * For now, we blindly initialize the path and rely on the upper layers to >+ * know whether the path is good or not (don't check the state before >+ * sending the activation request - just send it and do a best-effort). >+ * This should work fine for simple failover. Worst case, we are sending >+ * an extra START cmd on an already active path, but this should complete >+ * quickly and not affect the HP. >+ * One possible optimization would include some mechanism to detect an >+ * already in flight START command on the same controller and avoid sending >+ * another START in that case. >+ * >+ * Context: kmpathd (see process_queued_ios() in dm-mpath.c) >+ */ >+static void hp_sw_pg_init(struct hw_handler *hwh, unsigned bypassed, >+ struct dm_path *path) >+{ >+ struct request *req; >+ struct hp_sw_context *h; >+ unsigned err_flags; >+ >+ path->hwhcontext = hwh->context; >+ h = (struct hp_sw_context *) hwh->context; >+ >+ req = hp_sw_get_request(path); >+ if (!req) { >+ /* XXX - Remove this log message? */ >+ DMERR("hp_sw: could not allocate request for START_STOP"); >+ goto fail; >+ } >+ >+ /* XXX - Remove this log message? */ >+ DMINFO("hp_sw: queueing START_STOP command on %s", >+ path->dev->name); >+ >+ elv_add_request(req->q, req, ELEVATOR_INSERT_FRONT, 1); >+ return; >+ >+ fail: >+ err_flags = MP_FAIL_PATH; >+ dm_pg_init_complete(path, err_flags); >+} >+ >+static int hp_sw_create(struct hw_handler *hwh, unsigned argc, char **argv) >+{ >+ struct hp_sw_context *h; >+ >+ h = kmalloc(sizeof(*h), GFP_KERNEL); >+ if (!h) >+ return -ENOMEM; >+ hwh->context = h; >+ return 0; >+} >+ >+static void hp_sw_destroy(struct hw_handler *hwh) >+{ >+ struct hp_sw_context *h = hwh->context; >+ >+ kfree(h); >+ hwh->context = NULL; >+} >+ >+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, >+}; >+ >+static int __init hp_sw_init(void) >+{ >+ int r; >+ >+ if (hp_sw_cmd_timeout < MIN_CMD_TIMEOUT) >+ hp_sw_cmd_timeout = MIN_CMD_TIMEOUT; >+ >+ r = dm_register_hw_handler(&hp_sw_hwh); >+ if (r < 0) >+ DMERR("hp_sw: register failed %d", r); >+ >+ DMINFO("hp_sw version 0.977 loaded"); >+ >+ return r; >+} >+ >+static void __exit hp_sw_exit(void) >+{ >+ int r; >+ >+ /* FIXME: what about outstanding pg_inits? */ >+ >+ 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 (A/P) support for dm-multipath"); >+MODULE_AUTHOR("Mike Christie <michaelc@cs.wisc.edu>"); >+MODULE_LICENSE("GPL"); >Index: linux-2.6.22-rc1/drivers/md/Kconfig >=================================================================== >--- linux-2.6.22-rc1.orig/drivers/md/Kconfig >+++ linux-2.6.22-rc1/drivers/md/Kconfig >@@ -271,6 +271,12 @@ config DM_DELAY > > If unsure, say N. > >+config DM_MULTIPATH_HP >+ tristate "HP MSA multipath support (EXPERIMENTAL)" >+ depends on DM_MULTIPATH && BLK_DEV_DM && EXPERIMENTAL >+ ---help--- >+ Multipath support for HP MSA (Active/Passive) series hardware. >+ > endmenu > > endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 195685
:
131053
|
131073
|
131074
|
132388
|
140056
|
140721
|
140741
|
142204
|
142207
|
148162
|
148204
| 155210 |
292333
|
292553