Commit 2e51f78b authored by Brian King's avatar Brian King Committed by Martin K. Petersen

scsi: ibmvfc: Reinit target retries

If rport target discovery commands fail for some reason, they get retried
up to a set number of retries. Once the retry limit is exceeded, the target
is deleted. In order to delete the target, we either need to do an implicit
logout or a move login. In the move login case, if the move login fails, we
want to retry it. This ensures the retry counter gets reinitialized so the
move login will get retried.

Link: https://lore.kernel.org/r/1620756740-7045-4-git-send-email-brking@linux.vnet.ibm.comSigned-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5114975e
...@@ -654,8 +654,10 @@ static void ibmvfc_reinit_host(struct ibmvfc_host *vhost) ...@@ -654,8 +654,10 @@ static void ibmvfc_reinit_host(struct ibmvfc_host *vhost)
**/ **/
static void ibmvfc_del_tgt(struct ibmvfc_target *tgt) static void ibmvfc_del_tgt(struct ibmvfc_target *tgt)
{ {
if (!ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_LOGOUT_RPORT)) if (!ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_LOGOUT_RPORT)) {
tgt->job_step = ibmvfc_tgt_implicit_logout_and_del; tgt->job_step = ibmvfc_tgt_implicit_logout_and_del;
tgt->init_retries = 0;
}
wake_up(&tgt->vhost->work_wait_q); wake_up(&tgt->vhost->work_wait_q);
} }
...@@ -4744,6 +4746,7 @@ static int ibmvfc_alloc_target(struct ibmvfc_host *vhost, ...@@ -4744,6 +4746,7 @@ static int ibmvfc_alloc_target(struct ibmvfc_host *vhost,
*/ */
wtgt->new_scsi_id = scsi_id; wtgt->new_scsi_id = scsi_id;
wtgt->action = IBMVFC_TGT_ACTION_INIT; wtgt->action = IBMVFC_TGT_ACTION_INIT;
wtgt->init_retries = 0;
ibmvfc_init_tgt(wtgt, ibmvfc_tgt_move_login); ibmvfc_init_tgt(wtgt, ibmvfc_tgt_move_login);
} }
goto unlock_out; goto unlock_out;
...@@ -5336,6 +5339,7 @@ static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt) ...@@ -5336,6 +5339,7 @@ static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt)
tgt_dbg(tgt, "Deleting rport with outstanding I/O\n"); tgt_dbg(tgt, "Deleting rport with outstanding I/O\n");
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_LOGOUT_DELETED_RPORT); ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_LOGOUT_DELETED_RPORT);
tgt->rport = NULL; tgt->rport = NULL;
tgt->init_retries = 0;
spin_unlock_irqrestore(vhost->host->host_lock, flags); spin_unlock_irqrestore(vhost->host->host_lock, flags);
fc_remote_port_delete(rport); fc_remote_port_delete(rport);
return; return;
...@@ -5490,6 +5494,7 @@ static void ibmvfc_do_work(struct ibmvfc_host *vhost) ...@@ -5490,6 +5494,7 @@ static void ibmvfc_do_work(struct ibmvfc_host *vhost)
tgt_dbg(tgt, "Deleting rport with I/O outstanding\n"); tgt_dbg(tgt, "Deleting rport with I/O outstanding\n");
rport = tgt->rport; rport = tgt->rport;
tgt->rport = NULL; tgt->rport = NULL;
tgt->init_retries = 0;
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_LOGOUT_DELETED_RPORT); ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_LOGOUT_DELETED_RPORT);
/* /*
......
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