blob: d99fc14370cca18c60c6ff8c45e3c6eb1349708c [file] [log] [blame]
Hannes Reinecke057ea7c2008-07-17 16:53:21 -07001/*
2 * Generic SCSI-3 ALUA SCSI Device Handler
3 *
Hannes Reinecke69723d12010-09-24 15:57:04 +02004 * Copyright (C) 2007-2010 Hannes Reinecke, SUSE Linux Products GmbH.
Hannes Reinecke057ea7c2008-07-17 16:53:21 -07005 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 */
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090022#include <linux/slab.h>
Hannes Reinecke69723d12010-09-24 15:57:04 +020023#include <linux/delay.h>
Paul Gortmakeracf3368f2011-05-27 09:47:43 -040024#include <linux/module.h>
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070025#include <scsi/scsi.h>
Hannes Reinecke80bd68d2015-12-01 10:16:47 +010026#include <scsi/scsi_dbg.h>
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070027#include <scsi/scsi_eh.h>
28#include <scsi/scsi_dh.h>
29
30#define ALUA_DH_NAME "alua"
Hannes Reinecke69723d12010-09-24 15:57:04 +020031#define ALUA_DH_VER "1.3"
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070032
33#define TPGS_STATE_OPTIMIZED 0x0
34#define TPGS_STATE_NONOPTIMIZED 0x1
35#define TPGS_STATE_STANDBY 0x2
36#define TPGS_STATE_UNAVAILABLE 0x3
Hannes Reinecke69723d12010-09-24 15:57:04 +020037#define TPGS_STATE_LBA_DEPENDENT 0x4
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070038#define TPGS_STATE_OFFLINE 0xe
39#define TPGS_STATE_TRANSITIONING 0xf
40
41#define TPGS_SUPPORT_NONE 0x00
42#define TPGS_SUPPORT_OPTIMIZED 0x01
43#define TPGS_SUPPORT_NONOPTIMIZED 0x02
44#define TPGS_SUPPORT_STANDBY 0x04
45#define TPGS_SUPPORT_UNAVAILABLE 0x08
Hannes Reinecke69723d12010-09-24 15:57:04 +020046#define TPGS_SUPPORT_LBA_DEPENDENT 0x10
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070047#define TPGS_SUPPORT_OFFLINE 0x40
48#define TPGS_SUPPORT_TRANSITION 0x80
49
Rob Evers3588c5a2012-05-18 14:08:54 -040050#define RTPG_FMT_MASK 0x70
51#define RTPG_FMT_EXT_HDR 0x10
52
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070053#define TPGS_MODE_UNINITIALIZED -1
54#define TPGS_MODE_NONE 0x0
55#define TPGS_MODE_IMPLICIT 0x1
56#define TPGS_MODE_EXPLICIT 0x2
57
58#define ALUA_INQUIRY_SIZE 36
Rob Evers3588c5a2012-05-18 14:08:54 -040059#define ALUA_FAILOVER_TIMEOUT 60
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070060#define ALUA_FAILOVER_RETRIES 5
61
Hannes Reinecke6c4fc042015-12-01 10:16:51 +010062/* device handler flags */
Moger, Babu4335d092012-03-27 20:55:49 +000063#define ALUA_OPTIMIZE_STPG 1
Hannes Reinecke6c4fc042015-12-01 10:16:51 +010064#define ALUA_RTPG_EXT_HDR_UNSUPP 2
Moger, Babu4335d092012-03-27 20:55:49 +000065
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070066struct alua_dh_data {
67 int group_id;
68 int rel_port;
69 int tpgs;
70 int state;
Moger, Babudcd3a752012-03-27 20:56:08 +000071 int pref;
Moger, Babu4335d092012-03-27 20:55:49 +000072 unsigned flags; /* used for optimizing STPG */
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070073 unsigned char inq[ALUA_INQUIRY_SIZE];
74 unsigned char *buff;
75 int bufflen;
Rob Evers3588c5a2012-05-18 14:08:54 -040076 unsigned char transition_tmo;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070077 unsigned char sense[SCSI_SENSE_BUFFERSIZE];
Chandra Seetharaman96e65862009-10-21 09:23:04 -070078 struct scsi_device *sdev;
79 activate_complete callback_fn;
80 void *callback_data;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070081};
82
83#define ALUA_POLICY_SWITCH_CURRENT 0
84#define ALUA_POLICY_SWITCH_ALL 1
85
Chandra Seetharaman96e65862009-10-21 09:23:04 -070086static char print_alua_state(int);
87static int alua_check_sense(struct scsi_device *, struct scsi_sense_hdr *);
88
Hannes Reinecke057ea7c2008-07-17 16:53:21 -070089static int realloc_buffer(struct alua_dh_data *h, unsigned len)
90{
91 if (h->buff && h->buff != h->inq)
92 kfree(h->buff);
93
94 h->buff = kmalloc(len, GFP_NOIO);
95 if (!h->buff) {
96 h->buff = h->inq;
97 h->bufflen = ALUA_INQUIRY_SIZE;
98 return 1;
99 }
100 h->bufflen = len;
101 return 0;
102}
103
104static struct request *get_alua_req(struct scsi_device *sdev,
105 void *buffer, unsigned buflen, int rw)
106{
107 struct request *rq;
108 struct request_queue *q = sdev->request_queue;
109
110 rq = blk_get_request(q, rw, GFP_NOIO);
111
Joe Lawrencea492f072014-08-28 08:15:21 -0600112 if (IS_ERR(rq)) {
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700113 sdev_printk(KERN_INFO, sdev,
Harvey Harrisoncadbd4a2008-07-03 23:47:27 -0700114 "%s: blk_get_request failed\n", __func__);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700115 return NULL;
116 }
Jens Axboef27b0872014-06-06 07:57:37 -0600117 blk_rq_set_block_pc(rq);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700118
119 if (buflen && blk_rq_map_kern(q, rq, buffer, buflen, GFP_NOIO)) {
120 blk_put_request(rq);
121 sdev_printk(KERN_INFO, sdev,
Harvey Harrisoncadbd4a2008-07-03 23:47:27 -0700122 "%s: blk_rq_map_kern failed\n", __func__);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700123 return NULL;
124 }
125
Mike Christie6000a362008-08-19 18:45:30 -0500126 rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
Mike Christie64f84bc2008-09-06 08:39:16 -0500127 REQ_FAILFAST_DRIVER;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700128 rq->retries = ALUA_FAILOVER_RETRIES;
Rob Evers3588c5a2012-05-18 14:08:54 -0400129 rq->timeout = ALUA_FAILOVER_TIMEOUT * HZ;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700130
131 return rq;
132}
133
134/*
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700135 * submit_rtpg - Issue a REPORT TARGET GROUP STATES command
136 * @sdev: sdev the command should be sent to
137 */
Hannes Reinecke6c4fc042015-12-01 10:16:51 +0100138static unsigned submit_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700139{
140 struct request *rq;
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100141 int err = 0;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700142
143 rq = get_alua_req(sdev, h->buff, h->bufflen, READ);
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100144 if (!rq) {
145 err = DRIVER_BUSY << 24;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700146 goto done;
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100147 }
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700148
149 /* Prepare the command. */
150 rq->cmd[0] = MAINTENANCE_IN;
Hannes Reinecke6c4fc042015-12-01 10:16:51 +0100151 if (!(h->flags & ALUA_RTPG_EXT_HDR_UNSUPP))
Rob Evers8e67ce62012-05-18 14:08:55 -0400152 rq->cmd[1] = MI_REPORT_TARGET_PGS | MI_EXT_HDR_PARAM_FMT;
153 else
154 rq->cmd[1] = MI_REPORT_TARGET_PGS;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700155 rq->cmd[6] = (h->bufflen >> 24) & 0xff;
156 rq->cmd[7] = (h->bufflen >> 16) & 0xff;
157 rq->cmd[8] = (h->bufflen >> 8) & 0xff;
158 rq->cmd[9] = h->bufflen & 0xff;
159 rq->cmd_len = COMMAND_SIZE(MAINTENANCE_IN);
160
161 rq->sense = h->sense;
162 memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE);
Hannes Reinecked3692a32015-12-01 10:16:46 +0100163 rq->sense_len = 0;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700164
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100165 blk_execute_rq(rq->q, NULL, rq, 1);
166 if (rq->errors)
167 err = rq->errors;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700168 blk_put_request(rq);
169done:
170 return err;
171}
172
173/*
Hannes Reineckedac173e2015-12-01 10:16:49 +0100174 * stpg_endio - Evaluate SET TARGET GROUP STATES
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700175 * @sdev: the device to be evaluated
176 * @state: the new target group state
177 *
Hannes Reineckedac173e2015-12-01 10:16:49 +0100178 * Evaluate a SET TARGET GROUP STATES command response.
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700179 */
180static void stpg_endio(struct request *req, int error)
181{
182 struct alua_dh_data *h = req->end_io_data;
183 struct scsi_sense_hdr sense_hdr;
Joseph Gruher93499232011-01-05 16:00:22 -0500184 unsigned err = SCSI_DH_OK;
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700185
Mike Christie27db6822013-03-05 22:40:24 -0600186 if (host_byte(req->errors) != DID_OK ||
187 msg_byte(req->errors) != COMMAND_COMPLETE) {
Joseph Gruher93499232011-01-05 16:00:22 -0500188 err = SCSI_DH_IO;
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700189 goto done;
Joseph Gruher93499232011-01-05 16:00:22 -0500190 }
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700191
Hannes Reinecked3692a32015-12-01 10:16:46 +0100192 if (scsi_normalize_sense(h->sense, SCSI_SENSE_BUFFERSIZE,
193 &sense_hdr)) {
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700194 err = alua_check_sense(h->sdev, &sense_hdr);
195 if (err == ADD_TO_MLQUEUE) {
196 err = SCSI_DH_RETRY;
197 goto done;
198 }
Hannes Reinecke80bd68d2015-12-01 10:16:47 +0100199 sdev_printk(KERN_INFO, h->sdev, "%s: stpg failed\n",
200 ALUA_DH_NAME);
201 scsi_print_sense_hdr(h->sdev, ALUA_DH_NAME, &sense_hdr);
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700202 err = SCSI_DH_IO;
Mike Christie27db6822013-03-05 22:40:24 -0600203 } else if (error)
204 err = SCSI_DH_IO;
205
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700206 if (err == SCSI_DH_OK) {
207 h->state = TPGS_STATE_OPTIMIZED;
208 sdev_printk(KERN_INFO, h->sdev,
209 "%s: port group %02x switched to state %c\n",
210 ALUA_DH_NAME, h->group_id,
211 print_alua_state(h->state));
212 }
213done:
Joseph Gruhered0f36b2011-01-05 16:00:21 -0500214 req->end_io_data = NULL;
215 __blk_put_request(req->q, req);
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700216 if (h->callback_fn) {
217 h->callback_fn(h->callback_data, err);
218 h->callback_fn = h->callback_data = NULL;
219 }
220 return;
221}
222
223/*
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700224 * submit_stpg - Issue a SET TARGET GROUP STATES command
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700225 *
226 * Currently we're only setting the current target port group state
227 * to 'active/optimized' and let the array firmware figure out
228 * the states of the remaining groups.
229 */
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700230static unsigned submit_stpg(struct alua_dh_data *h)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700231{
232 struct request *rq;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700233 int stpg_len = 8;
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700234 struct scsi_device *sdev = h->sdev;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700235
236 /* Prepare the data buffer */
237 memset(h->buff, 0, stpg_len);
238 h->buff[4] = TPGS_STATE_OPTIMIZED & 0x0f;
Ilgu Hongef3fa8c2009-01-30 17:00:09 -0600239 h->buff[6] = (h->group_id >> 8) & 0xff;
240 h->buff[7] = h->group_id & 0xff;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700241
242 rq = get_alua_req(sdev, h->buff, stpg_len, WRITE);
243 if (!rq)
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700244 return SCSI_DH_RES_TEMP_UNAVAIL;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700245
246 /* Prepare the command. */
247 rq->cmd[0] = MAINTENANCE_OUT;
248 rq->cmd[1] = MO_SET_TARGET_PGS;
249 rq->cmd[6] = (stpg_len >> 24) & 0xff;
250 rq->cmd[7] = (stpg_len >> 16) & 0xff;
251 rq->cmd[8] = (stpg_len >> 8) & 0xff;
252 rq->cmd[9] = stpg_len & 0xff;
253 rq->cmd_len = COMMAND_SIZE(MAINTENANCE_OUT);
254
255 rq->sense = h->sense;
256 memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE);
Hannes Reinecked3692a32015-12-01 10:16:46 +0100257 rq->sense_len = 0;
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700258 rq->end_io_data = h;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700259
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700260 blk_execute_rq_nowait(rq->q, NULL, rq, 1, stpg_endio);
Joseph Gruher7c66e9a2011-01-05 16:00:20 -0500261 return SCSI_DH_OK;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700262}
263
264/*
Hannes Reinecked7c48fe2011-08-24 10:51:13 +0200265 * alua_check_tpgs - Evaluate TPGS setting
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700266 * @sdev: device to be checked
267 *
Hannes Reinecked7c48fe2011-08-24 10:51:13 +0200268 * Examine the TPGS setting of the sdev to find out if ALUA
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700269 * is supported.
270 */
Hannes Reinecked7c48fe2011-08-24 10:51:13 +0200271static int alua_check_tpgs(struct scsi_device *sdev, struct alua_dh_data *h)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700272{
Hannes Reinecked7c48fe2011-08-24 10:51:13 +0200273 int err = SCSI_DH_OK;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700274
Hannes Reineckedb5a6a62015-12-01 10:16:43 +0100275 /*
276 * ALUA support for non-disk devices is fraught with
277 * difficulties, so disable it for now.
278 */
279 if (sdev->type != TYPE_DISK) {
280 h->tpgs = TPGS_MODE_NONE;
281 sdev_printk(KERN_INFO, sdev,
282 "%s: disable for non-disk devices\n",
283 ALUA_DH_NAME);
284 return SCSI_DH_DEV_UNSUPP;
285 }
286
Hannes Reinecked7c48fe2011-08-24 10:51:13 +0200287 h->tpgs = scsi_device_tpgs(sdev);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700288 switch (h->tpgs) {
289 case TPGS_MODE_EXPLICIT|TPGS_MODE_IMPLICIT:
290 sdev_printk(KERN_INFO, sdev,
291 "%s: supports implicit and explicit TPGS\n",
292 ALUA_DH_NAME);
293 break;
294 case TPGS_MODE_EXPLICIT:
295 sdev_printk(KERN_INFO, sdev, "%s: supports explicit TPGS\n",
296 ALUA_DH_NAME);
297 break;
298 case TPGS_MODE_IMPLICIT:
299 sdev_printk(KERN_INFO, sdev, "%s: supports implicit TPGS\n",
300 ALUA_DH_NAME);
301 break;
Hannes Reinecke6cc05d42015-12-01 10:16:45 +0100302 case TPGS_MODE_NONE:
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700303 sdev_printk(KERN_INFO, sdev, "%s: not supported\n",
304 ALUA_DH_NAME);
305 err = SCSI_DH_DEV_UNSUPP;
306 break;
Hannes Reinecke6cc05d42015-12-01 10:16:45 +0100307 default:
308 sdev_printk(KERN_INFO, sdev,
309 "%s: unsupported TPGS setting %d\n",
310 ALUA_DH_NAME, h->tpgs);
311 h->tpgs = TPGS_MODE_NONE;
312 err = SCSI_DH_DEV_UNSUPP;
313 break;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700314 }
315
316 return err;
317}
318
319/*
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100320 * alua_check_vpd - Evaluate INQUIRY vpd page 0x83
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700321 * @sdev: device to be checked
322 *
323 * Extract the relative target port and the target port group
324 * descriptor from the list of identificators.
325 */
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100326static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700327{
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700328 unsigned char *d;
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100329 unsigned char __rcu *vpd_pg83;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700330
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100331 rcu_read_lock();
332 if (!rcu_dereference(sdev->vpd_pg83)) {
333 rcu_read_unlock();
334 return SCSI_DH_DEV_UNSUPP;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700335 }
336
337 /*
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100338 * Look for the correct descriptor.
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700339 */
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100340 vpd_pg83 = rcu_dereference(sdev->vpd_pg83);
341 d = vpd_pg83 + 4;
342 while (d < vpd_pg83 + sdev->vpd_pg83_len) {
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700343 switch (d[1] & 0xf) {
344 case 0x4:
345 /* Relative target port */
346 h->rel_port = (d[6] << 8) + d[7];
347 break;
348 case 0x5:
349 /* Target port group */
350 h->group_id = (d[6] << 8) + d[7];
351 break;
352 default:
353 break;
354 }
355 d += d[3] + 4;
356 }
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100357 rcu_read_unlock();
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700358
359 if (h->group_id == -1) {
360 /*
361 * Internal error; TPGS supported but required
362 * VPD identification descriptors not present.
363 * Disable ALUA support
364 */
365 sdev_printk(KERN_INFO, sdev,
366 "%s: No target port descriptors found\n",
367 ALUA_DH_NAME);
368 h->state = TPGS_STATE_OPTIMIZED;
369 h->tpgs = TPGS_MODE_NONE;
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100370 return SCSI_DH_DEV_UNSUPP;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700371 }
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100372 sdev_printk(KERN_INFO, sdev,
373 "%s: port group %02x rel port %02x\n",
374 ALUA_DH_NAME, h->group_id, h->rel_port);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700375
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100376 return 0;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700377}
378
379static char print_alua_state(int state)
380{
381 switch (state) {
382 case TPGS_STATE_OPTIMIZED:
383 return 'A';
384 case TPGS_STATE_NONOPTIMIZED:
385 return 'N';
386 case TPGS_STATE_STANDBY:
387 return 'S';
388 case TPGS_STATE_UNAVAILABLE:
389 return 'U';
Hannes Reinecke69723d12010-09-24 15:57:04 +0200390 case TPGS_STATE_LBA_DEPENDENT:
391 return 'L';
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700392 case TPGS_STATE_OFFLINE:
393 return 'O';
394 case TPGS_STATE_TRANSITIONING:
395 return 'T';
396 default:
397 return 'X';
398 }
399}
400
401static int alua_check_sense(struct scsi_device *sdev,
402 struct scsi_sense_hdr *sense_hdr)
403{
404 switch (sense_hdr->sense_key) {
405 case NOT_READY:
406 if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0a)
407 /*
408 * LUN Not Accessible - ALUA state transition
409 */
Mike Andersonc7dbb622008-08-12 12:11:57 -0700410 return ADD_TO_MLQUEUE;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700411 if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0b)
412 /*
413 * LUN Not Accessible -- Target port in standby state
414 */
415 return SUCCESS;
416 if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0c)
417 /*
418 * LUN Not Accessible -- Target port in unavailable state
419 */
420 return SUCCESS;
421 if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x12)
422 /*
423 * LUN Not Ready -- Offline
424 */
425 return SUCCESS;
wenxiong@linux.vnet.ibm.com333b2442014-11-06 15:11:23 -0600426 if (sdev->allow_restart &&
427 sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x02)
428 /*
429 * if the device is not started, we need to wake
430 * the error handler to start the motor
431 */
432 return FAILED;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700433 break;
434 case UNIT_ATTENTION:
435 if (sense_hdr->asc == 0x29 && sense_hdr->ascq == 0x00)
436 /*
437 * Power On, Reset, or Bus Device Reset, just retry.
438 */
Mike Andersonc7dbb622008-08-12 12:11:57 -0700439 return ADD_TO_MLQUEUE;
Stewart, Seanc20ee7b2013-10-15 15:52:39 +0000440 if (sense_hdr->asc == 0x29 && sense_hdr->ascq == 0x04)
441 /*
442 * Device internal reset
443 */
444 return ADD_TO_MLQUEUE;
Moger, Babu410f02d2011-12-21 18:01:37 -0500445 if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x01)
446 /*
447 * Mode Parameters Changed
448 */
449 return ADD_TO_MLQUEUE;
Moger, Babubf819732011-10-06 13:22:07 -0400450 if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x06)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700451 /*
452 * ALUA state changed
453 */
Mike Andersonc7dbb622008-08-12 12:11:57 -0700454 return ADD_TO_MLQUEUE;
Moger, Babubf819732011-10-06 13:22:07 -0400455 if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x07)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700456 /*
457 * Implicit ALUA state transition failed
458 */
Mike Andersonc7dbb622008-08-12 12:11:57 -0700459 return ADD_TO_MLQUEUE;
Moger, Babubf819732011-10-06 13:22:07 -0400460 if (sense_hdr->asc == 0x3f && sense_hdr->ascq == 0x03)
461 /*
462 * Inquiry data has changed
463 */
464 return ADD_TO_MLQUEUE;
465 if (sense_hdr->asc == 0x3f && sense_hdr->ascq == 0x0e)
Ilgu Hong4d086f62009-01-30 17:00:11 -0600466 /*
467 * REPORTED_LUNS_DATA_HAS_CHANGED is reported
468 * when switching controllers on targets like
469 * Intel Multi-Flex. We can just retry.
470 */
471 return ADD_TO_MLQUEUE;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700472 break;
473 }
474
475 return SCSI_RETURN_NOT_HANDLED;
476}
477
478/*
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700479 * alua_rtpg - Evaluate REPORT TARGET GROUP STATES
480 * @sdev: the device to be evaluated.
Stewart, Seana8e5a2d2013-10-15 15:52:54 +0000481 * @wait_for_transition: if nonzero, wait ALUA_FAILOVER_TIMEOUT seconds for device to exit transitioning state
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700482 *
483 * Evaluate the Target Port Group State.
484 * Returns SCSI_DH_DEV_OFFLINED if the path is
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300485 * found to be unusable.
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700486 */
Stewart, Seana8e5a2d2013-10-15 15:52:54 +0000487static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h, int wait_for_transition)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700488{
489 struct scsi_sense_hdr sense_hdr;
490 int len, k, off, valid_states = 0;
Hannes Reineckecfde3fa2011-08-24 10:51:18 +0200491 unsigned char *ucp;
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100492 unsigned err, retval;
Rob Eversbc97f4b2012-05-18 14:08:56 -0400493 unsigned long expiry, interval = 0;
Rob Evers3588c5a2012-05-18 14:08:54 -0400494 unsigned int tpg_desc_tbl_off;
495 unsigned char orig_transition_tmo;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700496
Rob Evers3588c5a2012-05-18 14:08:54 -0400497 if (!h->transition_tmo)
498 expiry = round_jiffies_up(jiffies + ALUA_FAILOVER_TIMEOUT * HZ);
499 else
500 expiry = round_jiffies_up(jiffies + h->transition_tmo * HZ);
501
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700502 retry:
Hannes Reinecke6c4fc042015-12-01 10:16:51 +0100503 retval = submit_rtpg(sdev, h);
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100504 if (retval) {
Hannes Reinecked3692a32015-12-01 10:16:46 +0100505 if (!scsi_normalize_sense(h->sense, SCSI_SENSE_BUFFERSIZE,
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100506 &sense_hdr)) {
507 sdev_printk(KERN_INFO, sdev,
508 "%s: rtpg failed, result %d\n",
509 ALUA_DH_NAME, retval);
510 if (driver_byte(retval) == DRIVER_BUSY)
511 return SCSI_DH_DEV_TEMP_BUSY;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700512 return SCSI_DH_IO;
Hannes Reinecke5597caf2015-12-01 10:16:48 +0100513 }
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700514
Rob Evers8e67ce62012-05-18 14:08:55 -0400515 /*
516 * submit_rtpg() has failed on existing arrays
517 * when requesting extended header info, and
518 * the array doesn't support extended headers,
519 * even though it shouldn't according to T10.
520 * The retry without rtpg_ext_hdr_req set
521 * handles this.
522 */
Hannes Reinecke6c4fc042015-12-01 10:16:51 +0100523 if (!(h->flags & ALUA_RTPG_EXT_HDR_UNSUPP) &&
Rob Evers8e67ce62012-05-18 14:08:55 -0400524 sense_hdr.sense_key == ILLEGAL_REQUEST &&
525 sense_hdr.asc == 0x24 && sense_hdr.ascq == 0) {
Hannes Reinecke6c4fc042015-12-01 10:16:51 +0100526 h->flags |= ALUA_RTPG_EXT_HDR_UNSUPP;
Rob Evers8e67ce62012-05-18 14:08:55 -0400527 goto retry;
528 }
529
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700530 err = alua_check_sense(sdev, &sense_hdr);
Hannes Reinecke80bd68d2015-12-01 10:16:47 +0100531 if (err == ADD_TO_MLQUEUE && time_before(jiffies, expiry)) {
532 sdev_printk(KERN_ERR, sdev, "%s: rtpg retry\n",
533 ALUA_DH_NAME);
534 scsi_print_sense_hdr(sdev, ALUA_DH_NAME, &sense_hdr);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700535 goto retry;
Hannes Reinecke80bd68d2015-12-01 10:16:47 +0100536 }
537 sdev_printk(KERN_ERR, sdev, "%s: rtpg failed\n",
538 ALUA_DH_NAME);
539 scsi_print_sense_hdr(sdev, ALUA_DH_NAME, &sense_hdr);
540 return SCSI_DH_IO;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700541 }
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700542
543 len = (h->buff[0] << 24) + (h->buff[1] << 16) +
544 (h->buff[2] << 8) + h->buff[3] + 4;
545
546 if (len > h->bufflen) {
547 /* Resubmit with the correct length */
548 if (realloc_buffer(h, len)) {
549 sdev_printk(KERN_WARNING, sdev,
Harvey Harrisoncadbd4a2008-07-03 23:47:27 -0700550 "%s: kmalloc buffer failed\n",__func__);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700551 /* Temporary failure, bypass */
552 return SCSI_DH_DEV_TEMP_BUSY;
553 }
554 goto retry;
555 }
556
Rob Evers3588c5a2012-05-18 14:08:54 -0400557 orig_transition_tmo = h->transition_tmo;
558 if ((h->buff[4] & RTPG_FMT_MASK) == RTPG_FMT_EXT_HDR && h->buff[5] != 0)
559 h->transition_tmo = h->buff[5];
560 else
561 h->transition_tmo = ALUA_FAILOVER_TIMEOUT;
562
Stewart, Seana8e5a2d2013-10-15 15:52:54 +0000563 if (wait_for_transition && (orig_transition_tmo != h->transition_tmo)) {
Rob Evers3588c5a2012-05-18 14:08:54 -0400564 sdev_printk(KERN_INFO, sdev,
565 "%s: transition timeout set to %d seconds\n",
566 ALUA_DH_NAME, h->transition_tmo);
567 expiry = jiffies + h->transition_tmo * HZ;
568 }
569
570 if ((h->buff[4] & RTPG_FMT_MASK) == RTPG_FMT_EXT_HDR)
571 tpg_desc_tbl_off = 8;
572 else
573 tpg_desc_tbl_off = 4;
574
575 for (k = tpg_desc_tbl_off, ucp = h->buff + tpg_desc_tbl_off;
576 k < len;
577 k += off, ucp += off) {
578
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700579 if (h->group_id == (ucp[2] << 8) + ucp[3]) {
580 h->state = ucp[0] & 0x0f;
Moger, Babudcd3a752012-03-27 20:56:08 +0000581 h->pref = ucp[0] >> 7;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700582 valid_states = ucp[1];
583 }
584 off = 8 + (ucp[7] * 4);
585 }
586
587 sdev_printk(KERN_INFO, sdev,
Moger, Babudcd3a752012-03-27 20:56:08 +0000588 "%s: port group %02x state %c %s supports %c%c%c%c%c%c%c\n",
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700589 ALUA_DH_NAME, h->group_id, print_alua_state(h->state),
Moger, Babudcd3a752012-03-27 20:56:08 +0000590 h->pref ? "preferred" : "non-preferred",
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700591 valid_states&TPGS_SUPPORT_TRANSITION?'T':'t',
592 valid_states&TPGS_SUPPORT_OFFLINE?'O':'o',
Hannes Reinecke69723d12010-09-24 15:57:04 +0200593 valid_states&TPGS_SUPPORT_LBA_DEPENDENT?'L':'l',
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700594 valid_states&TPGS_SUPPORT_UNAVAILABLE?'U':'u',
595 valid_states&TPGS_SUPPORT_STANDBY?'S':'s',
596 valid_states&TPGS_SUPPORT_NONOPTIMIZED?'N':'n',
597 valid_states&TPGS_SUPPORT_OPTIMIZED?'A':'a');
598
Hannes Reinecke69723d12010-09-24 15:57:04 +0200599 switch (h->state) {
600 case TPGS_STATE_TRANSITIONING:
Stewart, Seana8e5a2d2013-10-15 15:52:54 +0000601 if (wait_for_transition) {
602 if (time_before(jiffies, expiry)) {
603 /* State transition, retry */
604 interval += 2000;
605 msleep(interval);
606 goto retry;
607 }
608 err = SCSI_DH_RETRY;
609 } else {
610 err = SCSI_DH_OK;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700611 }
Stewart, Seana8e5a2d2013-10-15 15:52:54 +0000612
Hannes Reinecke69723d12010-09-24 15:57:04 +0200613 /* Transitioning time exceeded, set port to standby */
Hannes Reinecke69723d12010-09-24 15:57:04 +0200614 h->state = TPGS_STATE_STANDBY;
615 break;
616 case TPGS_STATE_OFFLINE:
Bart Van Asschee47f8972012-08-24 09:08:41 +0000617 /* Path unusable */
Hannes Reinecke69723d12010-09-24 15:57:04 +0200618 err = SCSI_DH_DEV_OFFLINED;
619 break;
620 default:
621 /* Useable path if active */
622 err = SCSI_DH_OK;
623 break;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700624 }
625 return err;
626}
627
628/*
629 * alua_initialize - Initialize ALUA state
630 * @sdev: the device to be initialized
631 *
632 * For the prep_fn to work correctly we have
633 * to initialize the ALUA state for the device.
634 */
635static int alua_initialize(struct scsi_device *sdev, struct alua_dh_data *h)
636{
637 int err;
638
Hannes Reinecked7c48fe2011-08-24 10:51:13 +0200639 err = alua_check_tpgs(sdev, h);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700640 if (err != SCSI_DH_OK)
641 goto out;
642
Hannes Reinecke9b80dce2015-12-01 10:16:44 +0100643 err = alua_check_vpd(sdev, h);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700644 if (err != SCSI_DH_OK)
645 goto out;
646
Stewart, Seana8e5a2d2013-10-15 15:52:54 +0000647 err = alua_rtpg(sdev, h, 0);
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700648 if (err != SCSI_DH_OK)
649 goto out;
650
651out:
652 return err;
653}
Moger, Babu4335d092012-03-27 20:55:49 +0000654/*
655 * alua_set_params - set/unset the optimize flag
656 * @sdev: device on the path to be activated
657 * params - parameters in the following format
658 * "no_of_params\0param1\0param2\0param3\0...\0"
659 * For example, to set the flag pass the following parameters
660 * from multipath.conf
661 * hardware_handler "2 alua 1"
662 */
663static int alua_set_params(struct scsi_device *sdev, const char *params)
664{
Christoph Hellwigee14c672015-08-27 14:16:59 +0200665 struct alua_dh_data *h = sdev->handler_data;
Moger, Babu4335d092012-03-27 20:55:49 +0000666 unsigned int optimize = 0, argc;
667 const char *p = params;
668 int result = SCSI_DH_OK;
669
670 if ((sscanf(params, "%u", &argc) != 1) || (argc != 1))
671 return -EINVAL;
672
673 while (*p++)
674 ;
675 if ((sscanf(p, "%u", &optimize) != 1) || (optimize > 1))
676 return -EINVAL;
677
678 if (optimize)
679 h->flags |= ALUA_OPTIMIZE_STPG;
680 else
681 h->flags &= ~ALUA_OPTIMIZE_STPG;
682
683 return result;
684}
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700685
Stewart, Sean7a3ad392013-04-04 14:54:47 +0000686static uint optimize_stpg;
687module_param(optimize_stpg, uint, S_IRUGO|S_IWUSR);
688MODULE_PARM_DESC(optimize_stpg, "Allow use of a non-optimized path, rather than sending a STPG, when implicit TPGS is supported (0=No,1=Yes). Default is 0.");
689
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700690/*
691 * alua_activate - activate a path
692 * @sdev: device on the path to be activated
693 *
694 * We're currently switching the port group to be activated only and
695 * let the array figure out the rest.
696 * There may be other arrays which require us to switch all port groups
697 * based on a certain policy. But until we actually encounter them it
698 * should be okay.
699 */
Chandra Seetharaman3ae31f62009-10-21 09:22:46 -0700700static int alua_activate(struct scsi_device *sdev,
701 activate_complete fn, void *data)
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700702{
Christoph Hellwigee14c672015-08-27 14:16:59 +0200703 struct alua_dh_data *h = sdev->handler_data;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700704 int err = SCSI_DH_OK;
Moger, Babu72d9e0f2012-03-27 20:56:20 +0000705 int stpg = 0;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700706
Stewart, Seana8e5a2d2013-10-15 15:52:54 +0000707 err = alua_rtpg(sdev, h, 1);
Hannes Reinecke46ccf6b2011-08-24 10:51:16 +0200708 if (err != SCSI_DH_OK)
709 goto out;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700710
Stewart, Sean7a3ad392013-04-04 14:54:47 +0000711 if (optimize_stpg)
712 h->flags |= ALUA_OPTIMIZE_STPG;
713
Moger, Babu72d9e0f2012-03-27 20:56:20 +0000714 if (h->tpgs & TPGS_MODE_EXPLICIT) {
715 switch (h->state) {
716 case TPGS_STATE_NONOPTIMIZED:
717 stpg = 1;
718 if ((h->flags & ALUA_OPTIMIZE_STPG) &&
719 (!h->pref) &&
720 (h->tpgs & TPGS_MODE_IMPLICIT))
721 stpg = 0;
722 break;
723 case TPGS_STATE_STANDBY:
Bart Van Asschebb2c94a2012-06-22 08:49:38 +0000724 case TPGS_STATE_UNAVAILABLE:
Moger, Babu72d9e0f2012-03-27 20:56:20 +0000725 stpg = 1;
726 break;
Moger, Babu72d9e0f2012-03-27 20:56:20 +0000727 case TPGS_STATE_OFFLINE:
728 err = SCSI_DH_IO;
729 break;
730 case TPGS_STATE_TRANSITIONING:
731 err = SCSI_DH_RETRY;
732 break;
733 default:
734 break;
735 }
736 }
737
738 if (stpg) {
Chandra Seetharaman96e65862009-10-21 09:23:04 -0700739 h->callback_fn = fn;
740 h->callback_data = data;
741 err = submit_stpg(h);
742 if (err == SCSI_DH_OK)
743 return 0;
744 h->callback_fn = h->callback_data = NULL;
745 }
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700746
747out:
Chandra Seetharaman3ae31f62009-10-21 09:22:46 -0700748 if (fn)
749 fn(data, err);
750 return 0;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700751}
752
753/*
754 * alua_prep_fn - request callback
755 *
756 * Fail I/O to all paths not in state
757 * active/optimized or active/non-optimized.
758 */
759static int alua_prep_fn(struct scsi_device *sdev, struct request *req)
760{
Christoph Hellwigee14c672015-08-27 14:16:59 +0200761 struct alua_dh_data *h = sdev->handler_data;
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700762 int ret = BLKPREP_OK;
763
Hannes Reinecke69723d12010-09-24 15:57:04 +0200764 if (h->state == TPGS_STATE_TRANSITIONING)
765 ret = BLKPREP_DEFER;
766 else if (h->state != TPGS_STATE_OPTIMIZED &&
767 h->state != TPGS_STATE_NONOPTIMIZED &&
768 h->state != TPGS_STATE_LBA_DEPENDENT) {
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700769 ret = BLKPREP_KILL;
770 req->cmd_flags |= REQ_QUIET;
771 }
772 return ret;
773
774}
775
Christoph Hellwig1d520322014-09-14 11:08:21 -0700776/*
777 * alua_bus_attach - Attach device handler
778 * @sdev: device to be attached to
779 */
Christoph Hellwigee14c672015-08-27 14:16:59 +0200780static int alua_bus_attach(struct scsi_device *sdev)
Christoph Hellwig1d520322014-09-14 11:08:21 -0700781{
782 struct alua_dh_data *h;
783 int err;
784
785 h = kzalloc(sizeof(*h) , GFP_KERNEL);
786 if (!h)
Christoph Hellwigee14c672015-08-27 14:16:59 +0200787 return -ENOMEM;
Christoph Hellwig1d520322014-09-14 11:08:21 -0700788 h->tpgs = TPGS_MODE_UNINITIALIZED;
789 h->state = TPGS_STATE_OPTIMIZED;
790 h->group_id = -1;
791 h->rel_port = -1;
792 h->buff = h->inq;
793 h->bufflen = ALUA_INQUIRY_SIZE;
794 h->sdev = sdev;
795
796 err = alua_initialize(sdev, h);
797 if (err != SCSI_DH_OK && err != SCSI_DH_DEV_OFFLINED)
798 goto failed;
799
Christoph Hellwigee14c672015-08-27 14:16:59 +0200800 sdev->handler_data = h;
801 return 0;
Christoph Hellwig1d520322014-09-14 11:08:21 -0700802failed:
803 kfree(h);
Christoph Hellwigee14c672015-08-27 14:16:59 +0200804 return -EINVAL;
Christoph Hellwig1d520322014-09-14 11:08:21 -0700805}
806
807/*
808 * alua_bus_detach - Detach device handler
809 * @sdev: device to be detached from
810 */
811static void alua_bus_detach(struct scsi_device *sdev)
812{
Christoph Hellwigee14c672015-08-27 14:16:59 +0200813 struct alua_dh_data *h = sdev->handler_data;
Christoph Hellwig1d520322014-09-14 11:08:21 -0700814
815 if (h->buff && h->inq != h->buff)
816 kfree(h->buff);
Christoph Hellwigee14c672015-08-27 14:16:59 +0200817 sdev->handler_data = NULL;
Christoph Hellwig1d520322014-09-14 11:08:21 -0700818 kfree(h);
819}
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700820
821static struct scsi_device_handler alua_dh = {
822 .name = ALUA_DH_NAME,
823 .module = THIS_MODULE,
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700824 .attach = alua_bus_attach,
825 .detach = alua_bus_detach,
826 .prep_fn = alua_prep_fn,
827 .check_sense = alua_check_sense,
828 .activate = alua_activate,
Moger, Babu4335d092012-03-27 20:55:49 +0000829 .set_params = alua_set_params,
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700830};
831
Hannes Reinecke057ea7c2008-07-17 16:53:21 -0700832static int __init alua_init(void)
833{
834 int r;
835
836 r = scsi_register_device_handler(&alua_dh);
837 if (r != 0)
838 printk(KERN_ERR "%s: Failed to register scsi device handler",
839 ALUA_DH_NAME);
840 return r;
841}
842
843static void __exit alua_exit(void)
844{
845 scsi_unregister_device_handler(&alua_dh);
846}
847
848module_init(alua_init);
849module_exit(alua_exit);
850
851MODULE_DESCRIPTION("DM Multipath ALUA support");
852MODULE_AUTHOR("Hannes Reinecke <hare@suse.de>");
853MODULE_LICENSE("GPL");
854MODULE_VERSION(ALUA_DH_VER);