1 From: Gerald Schaefer <geraldsc@de.ibm.com>
2 Subject: zfcp: Only issue one test link command per port
3 References: bnc#529188,LTC#55337
5 Symptom: During error recovery, the SAN trace shows a long series
6 of els adisc commands being issued to the same remote port.
7 Problem: When the FCP channel returns a series of failed commands,
8 a els adisc test link command is issued for each failed
10 Solution: Introduce a flag to ensure only one els adisc is pending
11 at one time. This is enough to trigger follow-on actions.
13 Acked-by: John Jolly <jjolly@suse.de>
15 drivers/s390/scsi/zfcp_def.h | 1 +
16 drivers/s390/scsi/zfcp_fc.c | 9 +++++++++
17 2 files changed, 10 insertions(+)
19 --- a/drivers/s390/scsi/zfcp_def.h 2009-07-16 12:20:57.000000000 +0200
20 +++ b/drivers/s390/scsi/zfcp_def.h 2009-07-16 12:22:20.000000000 +0200
21 @@ -260,6 +260,7 @@ struct zfcp_ls_adisc {
22 #define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004
23 #define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
24 #define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
25 +#define ZFCP_STATUS_PORT_LINK_TEST 0x00000040
27 /* well known address (WKA) port status*/
28 enum zfcp_wka_status {
29 --- a/drivers/s390/scsi/zfcp_fc.c 2009-07-16 12:20:57.000000000 +0200
30 +++ b/drivers/s390/scsi/zfcp_fc.c 2009-07-16 12:23:15.000000000 +0200
31 @@ -389,6 +389,7 @@ static void zfcp_fc_adisc_handler(unsign
32 zfcp_scsi_schedule_rport_register(port);
35 + atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
39 @@ -435,13 +436,21 @@ void zfcp_fc_link_test_work(struct work_
40 port->rport_task = RPORT_DEL;
41 zfcp_scsi_rport_work(&port->rport_work);
43 + /* only issue one test command at one time per port */
44 + if (atomic_read(&port->status) & ZFCP_STATUS_PORT_LINK_TEST)
47 + atomic_set_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
49 retval = zfcp_fc_adisc(port);
53 /* send of ADISC was not possible */
54 + atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
55 zfcp_erp_port_forced_reopen(port, 0, 65, NULL);