diff options
author | Ursula Braun <ubraun@linux.ibm.com> | 2018-08-10 11:45:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-10 17:38:43 -0400 |
commit | 0d86caff06363151df21603eb1f4e3207ea91bd2 (patch) | |
tree | 3b2fcbd52b79bf61771147ef81a0155943aeda2c /net/smc | |
parent | a487711aac3b720b4a3a63d737604f47cd8dc36c (diff) |
net/smc: send response to test link signal
With SMC-D z/OS sends a test link signal every 10 seconds. Linux is
supposed to answer, otherwise the SMC-D connection breaks.
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc')
-rw-r--r-- | net/smc/smc_ism.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c index cfade7fdcc6d..e36f21ce7252 100644 --- a/net/smc/smc_ism.c +++ b/net/smc/smc_ism.c | |||
@@ -184,6 +184,37 @@ struct smc_ism_event_work { | |||
184 | struct smcd_event event; | 184 | struct smcd_event event; |
185 | }; | 185 | }; |
186 | 186 | ||
187 | #define ISM_EVENT_REQUEST 0x0001 | ||
188 | #define ISM_EVENT_RESPONSE 0x0002 | ||
189 | #define ISM_EVENT_REQUEST_IR 0x00000001 | ||
190 | #define ISM_EVENT_CODE_TESTLINK 0x83 | ||
191 | |||
192 | static void smcd_handle_sw_event(struct smc_ism_event_work *wrk) | ||
193 | { | ||
194 | union { | ||
195 | u64 info; | ||
196 | struct { | ||
197 | u32 uid; | ||
198 | unsigned short vlanid; | ||
199 | u16 code; | ||
200 | }; | ||
201 | } ev_info; | ||
202 | |||
203 | switch (wrk->event.code) { | ||
204 | case ISM_EVENT_CODE_TESTLINK: /* Activity timer */ | ||
205 | ev_info.info = wrk->event.info; | ||
206 | if (ev_info.code == ISM_EVENT_REQUEST) { | ||
207 | ev_info.code = ISM_EVENT_RESPONSE; | ||
208 | wrk->smcd->ops->signal_event(wrk->smcd, | ||
209 | wrk->event.tok, | ||
210 | ISM_EVENT_REQUEST_IR, | ||
211 | ISM_EVENT_CODE_TESTLINK, | ||
212 | ev_info.info); | ||
213 | } | ||
214 | break; | ||
215 | } | ||
216 | } | ||
217 | |||
187 | /* worker for SMC-D events */ | 218 | /* worker for SMC-D events */ |
188 | static void smc_ism_event_work(struct work_struct *work) | 219 | static void smc_ism_event_work(struct work_struct *work) |
189 | { | 220 | { |
@@ -196,6 +227,9 @@ static void smc_ism_event_work(struct work_struct *work) | |||
196 | break; | 227 | break; |
197 | case ISM_EVENT_DMB: | 228 | case ISM_EVENT_DMB: |
198 | break; | 229 | break; |
230 | case ISM_EVENT_SWR: /* Software defined event */ | ||
231 | smcd_handle_sw_event(wrk); | ||
232 | break; | ||
199 | } | 233 | } |
200 | kfree(wrk); | 234 | kfree(wrk); |
201 | } | 235 | } |