iscsi: Treat unregistering pollers as a synchronous operation
We always unregister pollers from the core they're running on, so we don't need the async completion event when unregistering them. To avoid changing the logic, create events instead. Change-Id: Ib50d93e1578684bea69200d89a5e0d383acc8cfe Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/387685 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
9b63a93bab
commit
4927c20681
@ -763,9 +763,10 @@ spdk_iscsi_conn_check_shutdown(void *arg)
|
|||||||
struct spdk_event *event;
|
struct spdk_event *event;
|
||||||
|
|
||||||
if (spdk_iscsi_get_active_conns() == 0) {
|
if (spdk_iscsi_get_active_conns() == 0) {
|
||||||
|
spdk_poller_unregister(&g_shutdown_timer, NULL);
|
||||||
event = spdk_event_allocate(spdk_env_get_current_core(), spdk_iscsi_conn_check_shutdown_cb, NULL,
|
event = spdk_event_allocate(spdk_env_get_current_core(), spdk_iscsi_conn_check_shutdown_cb, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
spdk_poller_unregister(&g_shutdown_timer, event);
|
spdk_event_call(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,8 +831,9 @@ spdk_iscsi_conn_stop_poller(struct spdk_iscsi_conn *conn, spdk_event_fn fn_after
|
|||||||
}
|
}
|
||||||
__sync_fetch_and_sub(&g_num_connections[spdk_env_get_current_core()], 1);
|
__sync_fetch_and_sub(&g_num_connections[spdk_env_get_current_core()], 1);
|
||||||
spdk_net_framework_clear_socket_association(conn->sock);
|
spdk_net_framework_clear_socket_association(conn->sock);
|
||||||
|
spdk_poller_unregister(&conn->poller, NULL);
|
||||||
event = spdk_event_allocate(lcore, fn_after_stop, conn, NULL);
|
event = spdk_event_allocate(lcore, fn_after_stop, conn, NULL);
|
||||||
spdk_poller_unregister(&conn->poller, event);
|
spdk_event_call(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void spdk_shutdown_iscsi_conns(void)
|
void spdk_shutdown_iscsi_conns(void)
|
||||||
@ -1448,7 +1450,8 @@ spdk_iscsi_conn_login_do_work(void *arg)
|
|||||||
__sync_fetch_and_sub(&g_num_connections[spdk_env_get_current_core()], 1);
|
__sync_fetch_and_sub(&g_num_connections[spdk_env_get_current_core()], 1);
|
||||||
__sync_fetch_and_add(&g_num_connections[lcore], 1);
|
__sync_fetch_and_add(&g_num_connections[lcore], 1);
|
||||||
spdk_net_framework_clear_socket_association(conn->sock);
|
spdk_net_framework_clear_socket_association(conn->sock);
|
||||||
spdk_poller_unregister(&conn->poller, event);
|
spdk_poller_unregister(&conn->poller, NULL);
|
||||||
|
spdk_event_call(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user