]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Gerald Schaefer <geraldsc@de.ibm.com> |
2 | Subject: zfcp: Send ELS ADISC from workqueue | |
3 | References: bnc#482818,LTC#51958 | |
4 | ||
5 | Symptom: Remote port status change not handled | |
6 | with high I/O load on other ports. | |
7 | Problem: The ELS ADISC command used for checking | |
8 | the remote port status could not be sent | |
9 | because of a full request queue. | |
10 | Solution: Move issing the ELS ADISC request to | |
11 | a workqueue that can wait for a slot | |
12 | in the request queue to become free. | |
13 | ||
14 | Acked-by: John Jolly <jjolly@suse.de> | |
15 | --- | |
16 | drivers/s390/scsi/zfcp_aux.c | 1 + | |
17 | drivers/s390/scsi/zfcp_def.h | 1 + | |
18 | drivers/s390/scsi/zfcp_ext.h | 1 + | |
19 | drivers/s390/scsi/zfcp_fc.c | 28 ++++++++++++++++++---------- | |
20 | drivers/s390/scsi/zfcp_fsf.c | 18 ++++++------------ | |
21 | 5 files changed, 27 insertions(+), 22 deletions(-) | |
22 | ||
23 | --- a/drivers/s390/scsi/zfcp_aux.c | |
24 | +++ b/drivers/s390/scsi/zfcp_aux.c | |
25 | @@ -611,6 +611,7 @@ struct zfcp_port *zfcp_port_enqueue(stru | |
26 | init_waitqueue_head(&port->remove_wq); | |
27 | INIT_LIST_HEAD(&port->unit_list_head); | |
28 | INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup); | |
29 | + INIT_WORK(&port->test_link_work, zfcp_fc_link_test_work); | |
30 | ||
31 | port->adapter = adapter; | |
32 | port->d_id = d_id; | |
33 | --- a/drivers/s390/scsi/zfcp_def.h | |
34 | +++ b/drivers/s390/scsi/zfcp_def.h | |
35 | @@ -539,6 +539,7 @@ struct zfcp_port { | |
36 | u32 maxframe_size; | |
37 | u32 supported_classes; | |
38 | struct work_struct gid_pn_work; | |
39 | + struct work_struct test_link_work; | |
40 | }; | |
41 | ||
42 | struct zfcp_unit { | |
43 | --- a/drivers/s390/scsi/zfcp_ext.h | |
44 | +++ b/drivers/s390/scsi/zfcp_ext.h | |
45 | @@ -101,6 +101,7 @@ extern void zfcp_fc_incoming_els(struct | |
46 | extern int zfcp_fc_ns_gid_pn(struct zfcp_erp_action *); | |
47 | extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *); | |
48 | extern void zfcp_test_link(struct zfcp_port *); | |
49 | +extern void zfcp_fc_link_test_work(struct work_struct *); | |
50 | extern void zfcp_fc_nameserver_init(struct zfcp_adapter *); | |
51 | ||
52 | /* zfcp_fsf.c */ | |
53 | --- a/drivers/s390/scsi/zfcp_fc.c | |
54 | +++ b/drivers/s390/scsi/zfcp_fc.c | |
55 | @@ -415,19 +415,12 @@ static int zfcp_fc_adisc(struct zfcp_por | |
56 | return zfcp_fsf_send_els(&adisc->els); | |
57 | } | |
58 | ||
59 | -/** | |
60 | - * zfcp_test_link - lightweight link test procedure | |
61 | - * @port: port to be tested | |
62 | - * | |
63 | - * Test status of a link to a remote port using the ELS command ADISC. | |
64 | - * If there is a problem with the remote port, error recovery steps | |
65 | - * will be triggered. | |
66 | - */ | |
67 | -void zfcp_test_link(struct zfcp_port *port) | |
68 | +void zfcp_fc_link_test_work(struct work_struct *work) | |
69 | { | |
70 | + struct zfcp_port *port = | |
71 | + container_of(work, struct zfcp_port, test_link_work); | |
72 | int retval; | |
73 | ||
74 | - zfcp_port_get(port); | |
75 | retval = zfcp_fc_adisc(port); | |
76 | if (retval == 0) | |
77 | return; | |
78 | @@ -438,6 +431,21 @@ void zfcp_test_link(struct zfcp_port *po | |
79 | zfcp_erp_port_forced_reopen(port, 0, 65, NULL); | |
80 | } | |
81 | ||
82 | +/** | |
83 | + * zfcp_test_link - lightweight link test procedure | |
84 | + * @port: port to be tested | |
85 | + * | |
86 | + * Test status of a link to a remote port using the ELS command ADISC. | |
87 | + * If there is a problem with the remote port, error recovery steps | |
88 | + * will be triggered. | |
89 | + */ | |
90 | +void zfcp_test_link(struct zfcp_port *port) | |
91 | +{ | |
92 | + zfcp_port_get(port); | |
93 | + if (!queue_work(zfcp_data.work_queue, &port->test_link_work)) | |
94 | + zfcp_port_put(port); | |
95 | +} | |
96 | + | |
97 | static void zfcp_free_sg_env(struct zfcp_gpn_ft *gpn_ft, int buf_num) | |
98 | { | |
99 | struct scatterlist *sg = &gpn_ft->sg_req; | |
100 | --- a/drivers/s390/scsi/zfcp_fsf.c | |
101 | +++ b/drivers/s390/scsi/zfcp_fsf.c | |
102 | @@ -654,14 +654,6 @@ static int zfcp_fsf_sbal_check(struct zf | |
103 | return 0; | |
104 | } | |
105 | ||
106 | -static int zfcp_fsf_sbal_available(struct zfcp_adapter *adapter) | |
107 | -{ | |
108 | - unsigned int count = atomic_read(&adapter->req_q.count); | |
109 | - if (!count) | |
110 | - atomic_inc(&adapter->qdio_outb_full); | |
111 | - return count > 0; | |
112 | -} | |
113 | - | |
114 | static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) | |
115 | { | |
116 | long ret; | |
117 | @@ -1177,8 +1169,8 @@ int zfcp_fsf_send_els(struct zfcp_send_e | |
118 | ZFCP_STATUS_COMMON_UNBLOCKED))) | |
119 | return -EBUSY; | |
120 | ||
121 | - spin_lock(&adapter->req_q_lock); | |
122 | - if (!zfcp_fsf_sbal_available(adapter)) | |
123 | + spin_lock_bh(&adapter->req_q_lock); | |
124 | + if (zfcp_fsf_req_sbal_get(adapter)) | |
125 | goto out; | |
126 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, | |
127 | ZFCP_REQ_AUTO_CLEANUP, NULL); | |
128 | @@ -1211,7 +1203,7 @@ int zfcp_fsf_send_els(struct zfcp_send_e | |
129 | failed_send: | |
130 | zfcp_fsf_req_free(req); | |
131 | out: | |
132 | - spin_unlock(&adapter->req_q_lock); | |
133 | + spin_unlock_bh(&adapter->req_q_lock); | |
134 | return ret; | |
135 | } | |
136 | ||
137 | @@ -2336,8 +2328,10 @@ int zfcp_fsf_send_fcp_command_task(struc | |
138 | return -EBUSY; | |
139 | ||
140 | spin_lock(&adapter->req_q_lock); | |
141 | - if (!zfcp_fsf_sbal_available(adapter)) | |
142 | + if (atomic_read(&adapter->req_q.count) <= 0) { | |
143 | + atomic_inc(&adapter->qdio_outb_full); | |
144 | goto out; | |
145 | + } | |
146 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, | |
147 | adapter->pool.fsf_req_scsi); | |
148 | if (IS_ERR(req)) { |