Commit a5b11dda authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: Remove some port flags

PORT_PHYS_CLOSING is only set and cleared, but not actually used
for status checking.

PORT_INVALID_WWPN is set when the GID_PN request does not return
a d_id for a remote port, e.g. when a remote port has been
unplugged. For this case, the d_id is zero. In the erp we can
check the d_id and use the normal escalation procedure that gives
up after three retries and remove the special case.

PORT_NO_WWPN is unused: Each port in the remote port list has a
valid wwpn. The WKA ports are now tracked outside the port
list. Remove the PORT_NO_WWPN flag, since this is no longer set
for any port.
Acked-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 77c01976
...@@ -249,8 +249,8 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter, ...@@ -249,8 +249,8 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter,
struct zfcp_port *port; struct zfcp_port *port;
list_for_each_entry(port, &adapter->port_list_head, list) list_for_each_entry(port, &adapter->port_list_head, list)
if ((port->wwpn == wwpn) && !(atomic_read(&port->status) & if ((port->wwpn == wwpn) &&
(ZFCP_STATUS_PORT_NO_WWPN | ZFCP_STATUS_COMMON_REMOVE))) !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE))
return port; return port;
return NULL; return NULL;
} }
...@@ -620,7 +620,6 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, ...@@ -620,7 +620,6 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
dev_set_drvdata(&port->sysfs_device, port); dev_set_drvdata(&port->sysfs_device, port);
read_lock_irq(&zfcp_data.config_lock); read_lock_irq(&zfcp_data.config_lock);
if (!(status & ZFCP_STATUS_PORT_NO_WWPN))
if (zfcp_get_port_by_wwpn(adapter, wwpn)) { if (zfcp_get_port_by_wwpn(adapter, wwpn)) {
read_unlock_irq(&zfcp_data.config_lock); read_unlock_irq(&zfcp_data.config_lock);
goto err_out_free; goto err_out_free;
......
...@@ -243,9 +243,6 @@ struct zfcp_ls_adisc { ...@@ -243,9 +243,6 @@ struct zfcp_ls_adisc {
/* remote port status */ /* remote port status */
#define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001 #define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001
#define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004
#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
/* well known address (WKA) port status*/ /* well known address (WKA) port status*/
enum zfcp_wka_status { enum zfcp_wka_status {
......
...@@ -777,10 +777,7 @@ static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) ...@@ -777,10 +777,7 @@ static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act)
static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port)
{ {
atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &port->status);
ZFCP_STATUS_PORT_PHYS_CLOSING |
ZFCP_STATUS_PORT_INVALID_WWPN,
&port->status);
} }
static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
...@@ -875,13 +872,8 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) ...@@ -875,13 +872,8 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act)
return ZFCP_ERP_CONTINUES; return ZFCP_ERP_CONTINUES;
} }
case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: case ZFCP_ERP_STEP_NAMESERVER_LOOKUP:
if (!port->d_id) { if (!port->d_id)
if (p_status & (ZFCP_STATUS_PORT_INVALID_WWPN)) {
zfcp_erp_port_failed(port, 26, NULL);
return ZFCP_ERP_EXIT;
}
return ZFCP_ERP_FAILED; return ZFCP_ERP_FAILED;
}
return zfcp_erp_port_strategy_open_port(act); return zfcp_erp_port_strategy_open_port(act);
case ZFCP_ERP_STEP_PORT_OPENING: case ZFCP_ERP_STEP_PORT_OPENING:
...@@ -1269,10 +1261,6 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) ...@@ -1269,10 +1261,6 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
case ZFCP_ERP_ACTION_REOPEN_PORT: case ZFCP_ERP_ACTION_REOPEN_PORT:
if (atomic_read(&port->status) & ZFCP_STATUS_PORT_NO_WWPN) {
zfcp_port_put(port);
return;
}
if ((result == ZFCP_ERP_SUCCEEDED) && !port->rport) if ((result == ZFCP_ERP_SUCCEEDED) && !port->rport)
zfcp_erp_rport_register(port); zfcp_erp_rport_register(port);
if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) { if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) {
......
...@@ -259,10 +259,9 @@ static void zfcp_fc_ns_gid_pn_eval(unsigned long data) ...@@ -259,10 +259,9 @@ static void zfcp_fc_ns_gid_pn_eval(unsigned long data)
if (ct->status) if (ct->status)
return; return;
if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT) { if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT)
atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status);
return; return;
}
/* paranoia */ /* paranoia */
if (ct_iu_req->wwpn != port->wwpn) if (ct_iu_req->wwpn != port->wwpn)
return; return;
......
...@@ -1712,7 +1712,7 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req) ...@@ -1712,7 +1712,7 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req)
struct zfcp_unit *unit; struct zfcp_unit *unit;
if (req->status & ZFCP_STATUS_FSFREQ_ERROR) if (req->status & ZFCP_STATUS_FSFREQ_ERROR)
goto skip_fsfstatus; return;
switch (header->fsf_status) { switch (header->fsf_status) {
case FSF_PORT_HANDLE_NOT_VALID: case FSF_PORT_HANDLE_NOT_VALID:
...@@ -1752,8 +1752,6 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req) ...@@ -1752,8 +1752,6 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req)
&unit->status); &unit->status);
break; break;
} }
skip_fsfstatus:
atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, &port->status);
} }
/** /**
...@@ -1789,8 +1787,6 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) ...@@ -1789,8 +1787,6 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
req->erp_action = erp_action; req->erp_action = erp_action;
req->handler = zfcp_fsf_close_physical_port_handler; req->handler = zfcp_fsf_close_physical_port_handler;
erp_action->fsf_req = req; erp_action->fsf_req = req;
atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING,
&erp_action->port->status);
zfcp_fsf_start_erp_timer(req); zfcp_fsf_start_erp_timer(req);
retval = zfcp_fsf_req_send(req); retval = zfcp_fsf_req_send(req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment