diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-11-24 10:54:13 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:02:15 -0500 |
commit | 7c7dc196814b9e1d5cc254dc579a5fa78ae524f7 (patch) | |
tree | efe4800a456fa97e1f10876840fbde0983264b18 /drivers/s390/scsi/zfcp_fsf.c | |
parent | 800c0cad962dcf630cabf3efdc5983619e73d4c9 (diff) |
[SCSI] zfcp: Simplify handling of ct and els requests
Remove some redundancies in FC related code and trace:
- drop redundant data from SAN trace (local s_id that only changes
during link down, ls_code that is already part of payload, d_id in
ct response trace that is always the same as in ct request trace)
- use one common fsf struct to hold zfcp data for ct and els requests
- leverage common fsf struct for FC passthrough job data, allocate it
with dd_bsg_data for passthrough requests and unify common code for
ct and els passthrough request
- simplify callback handling in zfcp_fc
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/zfcp_fsf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 057c93777f92..fb580b14a68e 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -961,10 +961,10 @@ out: | |||
961 | static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req) | 961 | static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req) |
962 | { | 962 | { |
963 | struct zfcp_adapter *adapter = req->adapter; | 963 | struct zfcp_adapter *adapter = req->adapter; |
964 | struct zfcp_send_ct *send_ct = req->data; | 964 | struct zfcp_fsf_ct_els *ct = req->data; |
965 | struct fsf_qtcb_header *header = &req->qtcb->header; | 965 | struct fsf_qtcb_header *header = &req->qtcb->header; |
966 | 966 | ||
967 | send_ct->status = -EINVAL; | 967 | ct->status = -EINVAL; |
968 | 968 | ||
969 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 969 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
970 | goto skip_fsfstatus; | 970 | goto skip_fsfstatus; |
@@ -972,7 +972,7 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req) | |||
972 | switch (header->fsf_status) { | 972 | switch (header->fsf_status) { |
973 | case FSF_GOOD: | 973 | case FSF_GOOD: |
974 | zfcp_dbf_san_ct_response(req); | 974 | zfcp_dbf_san_ct_response(req); |
975 | send_ct->status = 0; | 975 | ct->status = 0; |
976 | break; | 976 | break; |
977 | case FSF_SERVICE_CLASS_NOT_SUPPORTED: | 977 | case FSF_SERVICE_CLASS_NOT_SUPPORTED: |
978 | zfcp_fsf_class_not_supp(req); | 978 | zfcp_fsf_class_not_supp(req); |
@@ -1004,8 +1004,8 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req) | |||
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | skip_fsfstatus: | 1006 | skip_fsfstatus: |
1007 | if (send_ct->handler) | 1007 | if (ct->handler) |
1008 | send_ct->handler(send_ct->handler_data); | 1008 | ct->handler(ct->handler_data); |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | static void zfcp_fsf_setup_ct_els_unchained(struct qdio_buffer_element *sbale, | 1011 | static void zfcp_fsf_setup_ct_els_unchained(struct qdio_buffer_element *sbale, |
@@ -1094,9 +1094,9 @@ static int zfcp_fsf_setup_ct_els(struct zfcp_fsf_req *req, | |||
1094 | * @ct: pointer to struct zfcp_send_ct with data for request | 1094 | * @ct: pointer to struct zfcp_send_ct with data for request |
1095 | * @pool: if non-null this mempool is used to allocate struct zfcp_fsf_req | 1095 | * @pool: if non-null this mempool is used to allocate struct zfcp_fsf_req |
1096 | */ | 1096 | */ |
1097 | int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool) | 1097 | int zfcp_fsf_send_ct(struct zfcp_fc_wka_port *wka_port, |
1098 | struct zfcp_fsf_ct_els *ct, mempool_t *pool) | ||
1098 | { | 1099 | { |
1099 | struct zfcp_fc_wka_port *wka_port = ct->wka_port; | ||
1100 | struct zfcp_qdio *qdio = wka_port->adapter->qdio; | 1100 | struct zfcp_qdio *qdio = wka_port->adapter->qdio; |
1101 | struct zfcp_fsf_req *req; | 1101 | struct zfcp_fsf_req *req; |
1102 | int ret = -EIO; | 1102 | int ret = -EIO; |
@@ -1122,7 +1122,7 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool) | |||
1122 | req->qtcb->header.port_handle = wka_port->handle; | 1122 | req->qtcb->header.port_handle = wka_port->handle; |
1123 | req->data = ct; | 1123 | req->data = ct; |
1124 | 1124 | ||
1125 | zfcp_dbf_san_ct_request(req); | 1125 | zfcp_dbf_san_ct_request(req, wka_port->d_id); |
1126 | 1126 | ||
1127 | ret = zfcp_fsf_req_send(req); | 1127 | ret = zfcp_fsf_req_send(req); |
1128 | if (ret) | 1128 | if (ret) |
@@ -1139,7 +1139,7 @@ out: | |||
1139 | 1139 | ||
1140 | static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req) | 1140 | static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req) |
1141 | { | 1141 | { |
1142 | struct zfcp_send_els *send_els = req->data; | 1142 | struct zfcp_fsf_ct_els *send_els = req->data; |
1143 | struct zfcp_port *port = send_els->port; | 1143 | struct zfcp_port *port = send_els->port; |
1144 | struct fsf_qtcb_header *header = &req->qtcb->header; | 1144 | struct fsf_qtcb_header *header = &req->qtcb->header; |
1145 | 1145 | ||
@@ -1159,9 +1159,6 @@ static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req) | |||
1159 | case FSF_ADAPTER_STATUS_AVAILABLE: | 1159 | case FSF_ADAPTER_STATUS_AVAILABLE: |
1160 | switch (header->fsf_status_qual.word[0]){ | 1160 | switch (header->fsf_status_qual.word[0]){ |
1161 | case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: | 1161 | case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: |
1162 | if (port && (send_els->ls_code != ELS_ADISC)) | ||
1163 | zfcp_fc_test_link(port); | ||
1164 | /*fall through */ | ||
1165 | case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: | 1162 | case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: |
1166 | case FSF_SQ_RETRY_IF_POSSIBLE: | 1163 | case FSF_SQ_RETRY_IF_POSSIBLE: |
1167 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 1164 | req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
@@ -1193,10 +1190,11 @@ skip_fsfstatus: | |||
1193 | * zfcp_fsf_send_els - initiate an ELS command (FC-FS) | 1190 | * zfcp_fsf_send_els - initiate an ELS command (FC-FS) |
1194 | * @els: pointer to struct zfcp_send_els with data for the command | 1191 | * @els: pointer to struct zfcp_send_els with data for the command |
1195 | */ | 1192 | */ |
1196 | int zfcp_fsf_send_els(struct zfcp_send_els *els) | 1193 | int zfcp_fsf_send_els(struct zfcp_adapter *adapter, u32 d_id, |
1194 | struct zfcp_fsf_ct_els *els) | ||
1197 | { | 1195 | { |
1198 | struct zfcp_fsf_req *req; | 1196 | struct zfcp_fsf_req *req; |
1199 | struct zfcp_qdio *qdio = els->adapter->qdio; | 1197 | struct zfcp_qdio *qdio = adapter->qdio; |
1200 | int ret = -EIO; | 1198 | int ret = -EIO; |
1201 | 1199 | ||
1202 | spin_lock_bh(&qdio->req_q_lock); | 1200 | spin_lock_bh(&qdio->req_q_lock); |
@@ -1216,7 +1214,7 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
1216 | if (ret) | 1214 | if (ret) |
1217 | goto failed_send; | 1215 | goto failed_send; |
1218 | 1216 | ||
1219 | hton24(req->qtcb->bottom.support.d_id, els->d_id); | 1217 | hton24(req->qtcb->bottom.support.d_id, d_id); |
1220 | req->handler = zfcp_fsf_send_els_handler; | 1218 | req->handler = zfcp_fsf_send_els_handler; |
1221 | req->data = els; | 1219 | req->data = els; |
1222 | 1220 | ||