From 68ca0b63152578d3f8aa8e6c177ad38c933a062a Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 20 Sep 2016 12:45:37 -0700 Subject: [PATCH] iscsi: allocate/free I/O channels when connections start/stop on a core This will start testing the I/O channel allocation paths. I/O channels are not actually used for submitting I/O yet however. Signed-off-by: Jim Harris Change-Id: I901402633248170324db1e2fc8fb813f7629c2b0 --- lib/iscsi/conn.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index de887875b..148cc4f8f 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -683,6 +683,9 @@ spdk_iscsi_conn_stop_poller(struct spdk_iscsi_conn *conn, spdk_event_fn fn_after pthread_mutex_lock(&target->mutex); target->num_active_conns--; pthread_mutex_unlock(&target->mutex); + + RTE_VERIFY(conn->dev != NULL); + spdk_scsi_dev_free_io_channels(conn->dev); } rte_atomic32_dec(&g_num_connections[spdk_app_get_current_core()]); spdk_net_framework_clear_socket_association(conn->sock); @@ -1268,6 +1271,11 @@ spdk_iscsi_conn_full_feature_migrate(struct spdk_event *event) { struct spdk_iscsi_conn *conn = spdk_event_get_arg1(event); + if (conn->sess->session_type == SESSION_TYPE_NORMAL) { + RTE_VERIFY(conn->dev != NULL); + spdk_scsi_dev_allocate_io_channels(conn->dev); + } + /* The poller has been unregistered, so now we can re-register it on the new core. */ conn->lcore = spdk_app_get_current_core(); spdk_poller_register(&conn->poller, spdk_iscsi_conn_full_feature_do_work, conn,