lib/iscsi: Add pg_tag to the 2nd parameter of iscsi_conns_request_logout()
The upcoming new feature, iSCSI login redirection will requests connections whose portal group tag matches to logout asynchronously. Hence add pg_tag to the second parameter of iscsi_conns_request_logout() and iscsi_conns_request_logout() checks if conn->pg_tag is equal to the passed pg_tag. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Iaea37f28046396404c5b4faed01d748f2944288c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3160 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
aa69140dba
commit
c15a6180cd
@ -862,7 +862,7 @@ iscsi_conn_request_logout(struct spdk_iscsi_conn *conn)
|
||||
}
|
||||
|
||||
void
|
||||
iscsi_conns_request_logout(struct spdk_iscsi_tgt_node *target)
|
||||
iscsi_conns_request_logout(struct spdk_iscsi_tgt_node *target, int pg_tag)
|
||||
{
|
||||
struct spdk_iscsi_conn *conn;
|
||||
|
||||
@ -872,7 +872,8 @@ iscsi_conns_request_logout(struct spdk_iscsi_tgt_node *target)
|
||||
|
||||
pthread_mutex_lock(&g_conns_mutex);
|
||||
TAILQ_FOREACH(conn, &g_active_conns, conn_link) {
|
||||
if (target == NULL || conn->target == target) {
|
||||
if ((target == NULL) ||
|
||||
(conn->target == target && (pg_tag < 0 || conn->pg_tag == pg_tag))) {
|
||||
iscsi_conn_request_logout(conn);
|
||||
}
|
||||
}
|
||||
@ -882,7 +883,7 @@ iscsi_conns_request_logout(struct spdk_iscsi_tgt_node *target)
|
||||
void
|
||||
shutdown_iscsi_conns(void)
|
||||
{
|
||||
iscsi_conns_request_logout(NULL);
|
||||
iscsi_conns_request_logout(NULL, -1);
|
||||
|
||||
g_shutdown_timer = SPDK_POLLER_REGISTER(iscsi_conn_check_shutdown, NULL, 1000);
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ void iscsi_task_mgmt_cpl(struct spdk_scsi_task *scsi_task);
|
||||
|
||||
int initialize_iscsi_conns(void);
|
||||
void shutdown_iscsi_conns(void);
|
||||
void iscsi_conns_request_logout(struct spdk_iscsi_tgt_node *target);
|
||||
void iscsi_conns_request_logout(struct spdk_iscsi_tgt_node *target, int pg_tag);
|
||||
int iscsi_get_active_conns(struct spdk_iscsi_tgt_node *target);
|
||||
|
||||
int iscsi_conn_construct(struct spdk_iscsi_portal *portal, struct spdk_sock *sock);
|
||||
|
@ -687,7 +687,7 @@ iscsi_tgt_node_destruct(struct spdk_iscsi_tgt_node *target,
|
||||
target->destruct_cb_fn = cb_fn;
|
||||
target->destruct_cb_arg = cb_arg;
|
||||
|
||||
iscsi_conns_request_logout(target);
|
||||
iscsi_conns_request_logout(target, -1);
|
||||
|
||||
if (iscsi_get_active_conns(target) != 0) {
|
||||
target->destruct_poller = SPDK_POLLER_REGISTER(iscsi_tgt_node_check_active_conns,
|
||||
|
@ -160,7 +160,7 @@ DEFINE_STUB(spdk_scsi_dev_delete_port, int,
|
||||
|
||||
DEFINE_STUB_V(shutdown_iscsi_conns, (void));
|
||||
|
||||
DEFINE_STUB_V(iscsi_conns_request_logout, (struct spdk_iscsi_tgt_node *target));
|
||||
DEFINE_STUB_V(iscsi_conns_request_logout, (struct spdk_iscsi_tgt_node *target, int pg_tag));
|
||||
|
||||
DEFINE_STUB(iscsi_get_active_conns, int, (struct spdk_iscsi_tgt_node *target), 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user