mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
scsi: ibmvfc: add NVMe/FC Implicit Logout and Move Login support
Add protocol-specific handling for implicit logout and move-login operations on NVMe/FC targets. Select the NVMe/FC-specific implicit logout opcode when operating on an NVMe target and update the associated logging so protocol-specific operations are visible in debug output. This extends the existing target relogin and migration-related flows to work with NVMe targets as well as SCSI targets. These changes are needed so target reauthentication and target movement continue to work once NVMe/FC targets are added to the driver's state machine. Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com> Link: https://patch.msgid.link/20260723000149.969416-17-tyreld@linux.ibm.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
5e9dd03726
commit
577608a200
@@ -4318,7 +4318,7 @@ static void ibmvfc_tgt_implicit_logout_done(struct ibmvfc_event *evt)
|
||||
|
||||
switch (status) {
|
||||
case IBMVFC_MAD_SUCCESS:
|
||||
tgt_dbg(tgt, "Implicit Logout succeeded\n");
|
||||
tgt_dbg(tgt, "%s Implicit Logout succeeded\n", proto_type[tgt->protocol]);
|
||||
break;
|
||||
case IBMVFC_MAD_DRIVER_FAILED:
|
||||
kref_put(&tgt->kref, ibmvfc_release_tgt);
|
||||
@@ -4326,7 +4326,8 @@ static void ibmvfc_tgt_implicit_logout_done(struct ibmvfc_event *evt)
|
||||
return;
|
||||
case IBMVFC_MAD_FAILED:
|
||||
default:
|
||||
tgt_err(tgt, "Implicit Logout failed: rc=0x%02X\n", status);
|
||||
tgt_err(tgt, "%s Implicit Logout failed: rc=0x%02X\n",
|
||||
proto_type[tgt->protocol], status);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4359,7 +4360,10 @@ static struct ibmvfc_event *__ibmvfc_tgt_get_implicit_logout_evt(struct ibmvfc_t
|
||||
mad = &evt->iu.implicit_logout;
|
||||
memset(mad, 0, sizeof(*mad));
|
||||
mad->common.version = cpu_to_be32(1);
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_IMPLICIT_LOGOUT);
|
||||
if (tgt->protocol == IBMVFC_PROTO_SCSI)
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_IMPLICIT_LOGOUT);
|
||||
else
|
||||
mad->common.opcode = cpu_to_be32(IBMVFC_NVMF_IMPLICIT_LOGOUT);
|
||||
mad->common.length = cpu_to_be16(sizeof(*mad));
|
||||
mad->old_scsi_id = cpu_to_be64(tgt->scsi_id);
|
||||
return evt;
|
||||
@@ -4395,7 +4399,7 @@ static void ibmvfc_tgt_implicit_logout(struct ibmvfc_target *tgt)
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE);
|
||||
kref_put(&tgt->kref, ibmvfc_release_tgt);
|
||||
} else
|
||||
tgt_dbg(tgt, "Sent Implicit Logout\n");
|
||||
tgt_dbg(tgt, "%s Sent Implicit Logout\n", proto_type[tgt->protocol]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4425,7 +4429,8 @@ static void ibmvfc_tgt_implicit_logout_and_del_done(struct ibmvfc_event *evt)
|
||||
else
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_AND_LOGOUT_RPORT);
|
||||
|
||||
tgt_dbg(tgt, "Implicit Logout %s\n", (status == IBMVFC_MAD_SUCCESS) ? "succeeded" : "failed");
|
||||
tgt_dbg(tgt, "%s Implicit Logout %s\n", proto_type[tgt->protocol],
|
||||
(status == IBMVFC_MAD_SUCCESS) ? "succeeded" : "failed");
|
||||
kref_put(&tgt->kref, ibmvfc_release_tgt);
|
||||
wake_up(&vhost->work_wait_q);
|
||||
}
|
||||
@@ -4466,7 +4471,7 @@ static void ibmvfc_tgt_implicit_logout_and_del(struct ibmvfc_target *tgt)
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
kref_put(&tgt->kref, ibmvfc_release_tgt);
|
||||
} else
|
||||
tgt_dbg(tgt, "Sent Implicit Logout\n");
|
||||
tgt_dbg(tgt, "%s Sent Implicit Logout\n", proto_type[tgt->protocol]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4486,7 +4491,8 @@ static void ibmvfc_tgt_move_login_done(struct ibmvfc_event *evt)
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE);
|
||||
switch (status) {
|
||||
case IBMVFC_MAD_SUCCESS:
|
||||
tgt_dbg(tgt, "Move Login succeeded for new scsi_id: %llX\n", tgt->new_scsi_id);
|
||||
tgt_dbg(tgt, "%s Move Login succeeded for new scsi_id: %llX\n",
|
||||
proto_type[tgt->protocol], tgt->new_scsi_id);
|
||||
tgt->ids.node_name = wwn_to_u64(rsp->service_parms.node_name);
|
||||
tgt->ids.port_name = wwn_to_u64(rsp->service_parms.port_name);
|
||||
tgt->scsi_id = tgt->new_scsi_id;
|
||||
@@ -4507,8 +4513,9 @@ static void ibmvfc_tgt_move_login_done(struct ibmvfc_event *evt)
|
||||
level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_move_login);
|
||||
|
||||
tgt_log(tgt, level,
|
||||
"Move Login failed: new scsi_id: %llX, flags:%x, vios_flags:%x, rc=0x%02X\n",
|
||||
tgt->new_scsi_id, be32_to_cpu(rsp->flags), be16_to_cpu(rsp->vios_flags),
|
||||
"%s Move Login failed: new scsi_id: %llX, flags:%x, vios_flags:%x, rc=0x%02X\n",
|
||||
proto_type[tgt->protocol], tgt->new_scsi_id,
|
||||
be32_to_cpu(rsp->flags), be16_to_cpu(rsp->vios_flags),
|
||||
status);
|
||||
break;
|
||||
}
|
||||
@@ -4548,7 +4555,10 @@ static void ibmvfc_tgt_move_login(struct ibmvfc_target *tgt)
|
||||
move = &evt->iu.move_login;
|
||||
memset(move, 0, sizeof(*move));
|
||||
move->common.version = cpu_to_be32(1);
|
||||
move->common.opcode = cpu_to_be32(IBMVFC_MOVE_LOGIN);
|
||||
if (tgt->protocol == IBMVFC_PROTO_SCSI)
|
||||
move->common.opcode = cpu_to_be32(IBMVFC_MOVE_LOGIN);
|
||||
else
|
||||
move->common.opcode = cpu_to_be32(IBMVFC_NVMF_MOVE_LOGIN);
|
||||
move->common.length = cpu_to_be16(sizeof(*move));
|
||||
|
||||
move->old_scsi_id = cpu_to_be64(tgt->scsi_id);
|
||||
@@ -4561,7 +4571,8 @@ static void ibmvfc_tgt_move_login(struct ibmvfc_target *tgt)
|
||||
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
|
||||
kref_put(&tgt->kref, ibmvfc_release_tgt);
|
||||
} else
|
||||
tgt_dbg(tgt, "Sent Move Login for new scsi_id: %llX\n", tgt->new_scsi_id);
|
||||
tgt_dbg(tgt, "Sent %s Move Login for new scsi_id: %llX\n",
|
||||
proto_type[tgt->protocol], tgt->new_scsi_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user