diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-08-18 09:43:26 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 09:49:38 -0400 |
commit | 98fc4d5c8cd9bd1a412cca922feecb54c1c22d8e (patch) | |
tree | ba2985e12e493bad9a2d1b76476b9697f8aba7eb /drivers/s390/scsi | |
parent | 347c6a965dc110c91a77f65181fc011ee257a4a6 (diff) |
[SCSI] zfcp: Simplify and update ct/gs and els timeout handling
The recommendation for a timeout of 2 * R_A_TOV is the same for ct/gs
and els requests, so set it in the common function used for
initializing both request types. Besides, the timer inside zfcp should
only run longer than the timeout set for the channel, so 10 seconds
more should be enough (instead of 60 seconds).
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 5 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 3 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 15 |
3 files changed, 6 insertions, 17 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index ce65d88e280c..99830758e873 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -73,9 +73,6 @@ | |||
73 | 73 | ||
74 | /*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/ | 74 | /*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/ |
75 | 75 | ||
76 | /* timeout for name-server lookup (in seconds) */ | ||
77 | #define ZFCP_NS_GID_PN_TIMEOUT 10 | ||
78 | |||
79 | /* task attribute values in FCP-2 FCP_CMND IU */ | 76 | /* task attribute values in FCP-2 FCP_CMND IU */ |
80 | #define SIMPLE_Q 0 | 77 | #define SIMPLE_Q 0 |
81 | #define HEAD_OF_Q 1 | 78 | #define HEAD_OF_Q 1 |
@@ -319,7 +316,6 @@ struct ct_iu_gpn_ft_req { | |||
319 | * @resp: scatter-gather list for response | 316 | * @resp: scatter-gather list for response |
320 | * @handler: handler function (called for response to the request) | 317 | * @handler: handler function (called for response to the request) |
321 | * @handler_data: data passed to handler function | 318 | * @handler_data: data passed to handler function |
322 | * @timeout: FSF timeout for this request | ||
323 | * @completion: completion for synchronization purposes | 319 | * @completion: completion for synchronization purposes |
324 | * @status: used to pass error status to calling function | 320 | * @status: used to pass error status to calling function |
325 | */ | 321 | */ |
@@ -329,7 +325,6 @@ struct zfcp_send_ct { | |||
329 | struct scatterlist *resp; | 325 | struct scatterlist *resp; |
330 | void (*handler)(unsigned long); | 326 | void (*handler)(unsigned long); |
331 | unsigned long handler_data; | 327 | unsigned long handler_data; |
332 | int timeout; | ||
333 | struct completion *completion; | 328 | struct completion *completion; |
334 | int status; | 329 | int status; |
335 | }; | 330 | }; |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 5c1f12247e42..82f148d09968 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -283,7 +283,6 @@ static int zfcp_fc_ns_gid_pn_request(struct zfcp_port *port, | |||
283 | gid_pn->ct.wka_port = &adapter->gs->ds; | 283 | gid_pn->ct.wka_port = &adapter->gs->ds; |
284 | gid_pn->ct.handler = zfcp_fc_ns_handler; | 284 | gid_pn->ct.handler = zfcp_fc_ns_handler; |
285 | gid_pn->ct.handler_data = (unsigned long) &compl_rec; | 285 | gid_pn->ct.handler_data = (unsigned long) &compl_rec; |
286 | gid_pn->ct.timeout = ZFCP_NS_GID_PN_TIMEOUT; | ||
287 | gid_pn->ct.req = &gid_pn->req; | 286 | gid_pn->ct.req = &gid_pn->req; |
288 | gid_pn->ct.resp = &gid_pn->resp; | 287 | gid_pn->ct.resp = &gid_pn->resp; |
289 | sg_init_one(&gid_pn->req, &gid_pn->ct_iu_req, | 288 | sg_init_one(&gid_pn->req, &gid_pn->ct_iu_req, |
@@ -556,7 +555,6 @@ static int zfcp_fc_send_gpn_ft(struct zfcp_gpn_ft *gpn_ft, | |||
556 | ct->wka_port = &adapter->gs->ds; | 555 | ct->wka_port = &adapter->gs->ds; |
557 | ct->handler = zfcp_fc_ns_handler; | 556 | ct->handler = zfcp_fc_ns_handler; |
558 | ct->handler_data = (unsigned long)&compl_rec; | 557 | ct->handler_data = (unsigned long)&compl_rec; |
559 | ct->timeout = 10; | ||
560 | ct->req = &gpn_ft->sg_req; | 558 | ct->req = &gpn_ft->sg_req; |
561 | ct->resp = gpn_ft->sg_resp; | 559 | ct->resp = gpn_ft->sg_resp; |
562 | 560 | ||
@@ -845,7 +843,6 @@ int zfcp_fc_execute_ct_fc_job(struct fc_bsg_job *job) | |||
845 | 843 | ||
846 | ct_fc_job->ct.req = job->request_payload.sg_list; | 844 | ct_fc_job->ct.req = job->request_payload.sg_list; |
847 | ct_fc_job->ct.resp = job->reply_payload.sg_list; | 845 | ct_fc_job->ct.resp = job->reply_payload.sg_list; |
848 | ct_fc_job->ct.timeout = ZFCP_FSF_REQUEST_TIMEOUT; | ||
849 | ct_fc_job->ct.handler = zfcp_fc_generic_ct_handler; | 846 | ct_fc_job->ct.handler = zfcp_fc_generic_ct_handler; |
850 | ct_fc_job->ct.handler_data = (unsigned long) ct_fc_job; | 847 | ct_fc_job->ct.handler_data = (unsigned long) ct_fc_job; |
851 | ct_fc_job->ct.completion = NULL; | 848 | ct_fc_job->ct.completion = NULL; |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index c241f032fd49..f09c863dc6bd 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -1060,7 +1060,12 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, | |||
1060 | sg_resp, max_sbals); | 1060 | sg_resp, max_sbals); |
1061 | if (bytes <= 0) | 1061 | if (bytes <= 0) |
1062 | return -EIO; | 1062 | return -EIO; |
1063 | |||
1064 | /* common settings for ct/gs and els requests */ | ||
1063 | req->qtcb->bottom.support.resp_buf_length = bytes; | 1065 | req->qtcb->bottom.support.resp_buf_length = bytes; |
1066 | req->qtcb->bottom.support.service_class = FSF_CLASS_3; | ||
1067 | req->qtcb->bottom.support.timeout = 2 * R_A_TOV; | ||
1068 | zfcp_fsf_start_timer(req, 2 * R_A_TOV + 10); | ||
1064 | 1069 | ||
1065 | return 0; | 1070 | return 0; |
1066 | } | 1071 | } |
@@ -1096,12 +1101,9 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool) | |||
1096 | 1101 | ||
1097 | req->handler = zfcp_fsf_send_ct_handler; | 1102 | req->handler = zfcp_fsf_send_ct_handler; |
1098 | req->qtcb->header.port_handle = wka_port->handle; | 1103 | req->qtcb->header.port_handle = wka_port->handle; |
1099 | req->qtcb->bottom.support.service_class = FSF_CLASS_3; | ||
1100 | req->qtcb->bottom.support.timeout = ct->timeout; | ||
1101 | req->data = ct; | 1104 | req->data = ct; |
1102 | 1105 | ||
1103 | zfcp_dbf_san_ct_request(req); | 1106 | zfcp_dbf_san_ct_request(req); |
1104 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | ||
1105 | 1107 | ||
1106 | ret = zfcp_fsf_req_send(req); | 1108 | ret = zfcp_fsf_req_send(req); |
1107 | if (ret) | 1109 | if (ret) |
@@ -1176,7 +1178,6 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
1176 | { | 1178 | { |
1177 | struct zfcp_fsf_req *req; | 1179 | struct zfcp_fsf_req *req; |
1178 | struct zfcp_qdio *qdio = els->adapter->qdio; | 1180 | struct zfcp_qdio *qdio = els->adapter->qdio; |
1179 | struct fsf_qtcb_bottom_support *bottom; | ||
1180 | int ret = -EIO; | 1181 | int ret = -EIO; |
1181 | 1182 | ||
1182 | spin_lock_bh(&qdio->req_q_lock); | 1183 | spin_lock_bh(&qdio->req_q_lock); |
@@ -1196,16 +1197,12 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
1196 | if (ret) | 1197 | if (ret) |
1197 | goto failed_send; | 1198 | goto failed_send; |
1198 | 1199 | ||
1199 | bottom = &req->qtcb->bottom.support; | 1200 | req->qtcb->bottom.support.d_id = els->d_id; |
1200 | req->handler = zfcp_fsf_send_els_handler; | 1201 | req->handler = zfcp_fsf_send_els_handler; |
1201 | bottom->d_id = els->d_id; | ||
1202 | bottom->service_class = FSF_CLASS_3; | ||
1203 | bottom->timeout = 2 * R_A_TOV; | ||
1204 | req->data = els; | 1202 | req->data = els; |
1205 | 1203 | ||
1206 | zfcp_dbf_san_els_request(req); | 1204 | zfcp_dbf_san_els_request(req); |
1207 | 1205 | ||
1208 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | ||
1209 | ret = zfcp_fsf_req_send(req); | 1206 | ret = zfcp_fsf_req_send(req); |
1210 | if (ret) | 1207 | if (ret) |
1211 | goto failed_send; | 1208 | goto failed_send; |