From 4927c20681a7b923922b5158fd8ccb14cc45cec8 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 15 Nov 2017 11:02:42 -0700 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/387685 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp --- lib/iscsi/conn.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 948bd052c..08af1f36a 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -763,9 +763,10 @@ spdk_iscsi_conn_check_shutdown(void *arg) struct spdk_event *event; 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, 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); spdk_net_framework_clear_socket_association(conn->sock); + spdk_poller_unregister(&conn->poller, 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) @@ -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_add(&g_num_connections[lcore], 1); spdk_net_framework_clear_socket_association(conn->sock); - spdk_poller_unregister(&conn->poller, event); + spdk_poller_unregister(&conn->poller, NULL); + spdk_event_call(event); } }