aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_def.h
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 06:42:17 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 13:11:53 -0400
commit5ab944f97e09a3d52951fe903eed9a7b88d810b2 (patch)
tree266171323bd7c5dfc433efd70ca19aafc891598c /drivers/s390/scsi/zfcp_def.h
parent44cc76f2d154aa24340354b4711a0fe7f8f08adc (diff)
[SCSI] zfcp: attach and release SAN nameserver port on demand
Changing the zfcp behaviour from always having the nameserver port open to an on-demand strategy. This strategy reduces the use of limited resources like port connections. The patch provides a common infrastructure which could be used for all WKA ports in future. Also reduce the number of nameserver lookups by changing the zfcp behaviour of always querying the nameserver for the corresponding destination ID of the remote port. If the destination ID has changed during the reopen process we will be informed and then trigger a nameserver query on demand. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_def.h')
-rw-r--r--drivers/s390/scsi/zfcp_def.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 699ecaf2e503..0d6a388882d4 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -253,6 +253,7 @@ struct zfcp_ls_adisc {
253#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200 253#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200
254 254
255/* FC-PH/FC-GS well-known address identifiers for generic services */ 255/* FC-PH/FC-GS well-known address identifiers for generic services */
256#define ZFCP_DID_WKA 0xFFFFF0
256#define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA 257#define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA
257#define ZFCP_DID_TIME_SERVICE 0xFFFFFB 258#define ZFCP_DID_TIME_SERVICE 0xFFFFFB
258#define ZFCP_DID_DIRECTORY_SERVICE 0xFFFFFC 259#define ZFCP_DID_DIRECTORY_SERVICE 0xFFFFFC
@@ -264,13 +265,15 @@ struct zfcp_ls_adisc {
264#define ZFCP_STATUS_PORT_DID_DID 0x00000002 265#define ZFCP_STATUS_PORT_DID_DID 0x00000002
265#define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004 266#define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004
266#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 267#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
267#define ZFCP_STATUS_PORT_NO_SCSI_ID 0x00000010
268#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 268#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
269 269
270/* for ports with well known addresses */ 270/* well known address (WKA) port status*/
271#define ZFCP_STATUS_PORT_WKA \ 271enum zfcp_wka_status {
272 (ZFCP_STATUS_PORT_NO_WWPN | \ 272 ZFCP_WKA_PORT_OFFLINE,
273 ZFCP_STATUS_PORT_NO_SCSI_ID) 273 ZFCP_WKA_PORT_CLOSING,
274 ZFCP_WKA_PORT_OPENING,
275 ZFCP_WKA_PORT_ONLINE,
276};
274 277
275/* logical unit status */ 278/* logical unit status */
276#define ZFCP_STATUS_UNIT_SHARED 0x00000004 279#define ZFCP_STATUS_UNIT_SHARED 0x00000004
@@ -340,7 +343,7 @@ typedef void (*zfcp_send_ct_handler_t)(unsigned long);
340 343
341/** 344/**
342 * struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct 345 * struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct
343 * @port: port where the request is sent to 346 * @wka_port: port where the request is sent to
344 * @req: scatter-gather list for request 347 * @req: scatter-gather list for request
345 * @resp: scatter-gather list for response 348 * @resp: scatter-gather list for response
346 * @req_count: number of elements in request scatter-gather list 349 * @req_count: number of elements in request scatter-gather list
@@ -352,7 +355,7 @@ typedef void (*zfcp_send_ct_handler_t)(unsigned long);
352 * @status: used to pass error status to calling function 355 * @status: used to pass error status to calling function
353 */ 356 */
354struct zfcp_send_ct { 357struct zfcp_send_ct {
355 struct zfcp_port *port; 358 struct zfcp_wka_port *wka_port;
356 struct scatterlist *req; 359 struct scatterlist *req;
357 struct scatterlist *resp; 360 struct scatterlist *resp;
358 unsigned int req_count; 361 unsigned int req_count;
@@ -406,6 +409,17 @@ struct zfcp_send_els {
406 int status; 409 int status;
407}; 410};
408 411
412struct zfcp_wka_port {
413 struct zfcp_adapter *adapter;
414 wait_queue_head_t completion_wq;
415 enum zfcp_wka_status status;
416 atomic_t refcount;
417 u32 d_id;
418 u32 handle;
419 struct mutex mutex;
420 struct delayed_work work;
421};
422
409struct zfcp_qdio_queue { 423struct zfcp_qdio_queue {
410 struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q]; /* SBALs */ 424 struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q]; /* SBALs */
411 u8 first; /* index of next free bfr 425 u8 first; /* index of next free bfr
@@ -496,7 +510,7 @@ struct zfcp_adapter {
496 actions */ 510 actions */
497 u32 erp_low_mem_count; /* nr of erp actions waiting 511 u32 erp_low_mem_count; /* nr of erp actions waiting
498 for memory */ 512 for memory */
499 struct zfcp_port *nameserver_port; /* adapter's nameserver */ 513 struct zfcp_wka_port nsp; /* adapter's nameserver */
500 debug_info_t *rec_dbf; 514 debug_info_t *rec_dbf;
501 debug_info_t *hba_dbf; 515 debug_info_t *hba_dbf;
502 debug_info_t *san_dbf; /* debug feature areas */ 516 debug_info_t *san_dbf; /* debug feature areas */
@@ -540,6 +554,7 @@ struct zfcp_port {
540 atomic_t erp_counter; 554 atomic_t erp_counter;
541 u32 maxframe_size; 555 u32 maxframe_size;
542 u32 supported_classes; 556 u32 supported_classes;
557 struct work_struct gid_pn_work;
543}; 558};
544 559
545struct zfcp_unit { 560struct zfcp_unit {