iscsi: use spdk_app_get_current_core() for events

Change-Id: I3758c147b9aed291ecd5a1361e20786d4d377e19
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-08-08 11:09:19 -07:00
parent e2d622e0aa
commit 3c8183956e
3 changed files with 11 additions and 14 deletions

View File

@ -310,8 +310,8 @@ error_return:
* housekeeping for TCP socket to lcore associations gets cleared.
*/
spdk_net_framework_clear_socket_association(conn->sock);
rte_atomic32_inc(&g_num_connections[rte_lcore_id()]);
spdk_poller_register(&conn->poller, rte_lcore_id(), NULL, 0);
rte_atomic32_inc(&g_num_connections[spdk_app_get_current_core()]);
spdk_poller_register(&conn->poller, spdk_app_get_current_core(), NULL, 0);
return 0;
}
@ -449,7 +449,7 @@ _spdk_iscsi_conn_free(spdk_event_t event)
spdk_iscsi_remove_conn(conn);
pthread_mutex_unlock(&g_conns_mutex);
rte_atomic32_dec(&g_num_connections[rte_lcore_id()]);
rte_atomic32_dec(&g_num_connections[spdk_app_get_current_core()]);
}
static void
@ -466,7 +466,7 @@ _spdk_iscsi_conn_check_shutdown(struct rte_timer *timer, void *arg)
rte_timer_stop(timer);
event = spdk_event_allocate(rte_lcore_id(), _spdk_iscsi_conn_free,
event = spdk_event_allocate(spdk_app_get_current_core(), _spdk_iscsi_conn_free,
conn, NULL, NULL);
spdk_poller_unregister(&conn->poller, event);
}
@ -496,7 +496,7 @@ void spdk_iscsi_conn_destruct(struct spdk_iscsi_conn *conn)
rte_timer_reset(&conn->shutdown_timer, rte_get_timer_hz() / 1000, PERIODICAL,
rte_lcore_id(), _spdk_iscsi_conn_check_shutdown, conn);
} else {
event = spdk_event_allocate(rte_lcore_id(), _spdk_iscsi_conn_free,
event = spdk_event_allocate(spdk_app_get_current_core(), _spdk_iscsi_conn_free,
conn, NULL, NULL);
spdk_poller_unregister(&conn->poller, event);
}
@ -1039,7 +1039,7 @@ static void spdk_iscsi_conn_handle_idle(struct spdk_iscsi_conn *conn)
conn->pending_task_cnt == 0) {
spdk_trace_record(TRACE_ISCSI_CONN_IDLE, conn->id, 0, 0, 0);
rte_atomic32_dec(&g_num_connections[rte_lcore_id()]);
rte_atomic32_dec(&g_num_connections[spdk_app_get_current_core()]);
spdk_net_framework_clear_socket_association(conn->sock);
event = spdk_event_allocate(rte_get_master_lcore(), __add_idle_conn,
conn, NULL, NULL);
@ -1112,7 +1112,7 @@ spdk_iscsi_conn_login_do_work(void *arg)
if (conn->login_phase == ISCSI_FULL_FEATURE_PHASE) {
lcore = spdk_iscsi_conn_allocate_reactor(conn->portal->cpumask);
conn->poller.fn = spdk_iscsi_conn_full_feature_do_work;
rte_atomic32_dec(&g_num_connections[rte_lcore_id()]);
rte_atomic32_dec(&g_num_connections[spdk_app_get_current_core()]);
rte_atomic32_inc(&g_num_connections[lcore]);
spdk_net_framework_clear_socket_association(conn->sock);
spdk_poller_migrate(&conn->poller, lcore, NULL);

View File

@ -2838,7 +2838,7 @@ spdk_iscsi_compare_pdu_bhs_within_existed_r2t_tasks(struct spdk_iscsi_conn *conn
static void spdk_iscsi_queue_task(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_task *task)
{
task->scsi.cb_event = spdk_event_allocate(rte_lcore_id(), process_task_completion,
task->scsi.cb_event = spdk_event_allocate(spdk_app_get_current_core(), process_task_completion,
conn, task, NULL);
spdk_trace_record(TRACE_ISCSI_TASK_QUEUE, conn->id, task->scsi.length,
(uintptr_t)task, (uintptr_t)task->pdu);
@ -2848,7 +2848,7 @@ static void spdk_iscsi_queue_task(struct spdk_iscsi_conn *conn,
static void spdk_iscsi_queue_mgmt_task(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_task *task)
{
task->scsi.cb_event = spdk_event_allocate(rte_lcore_id(), process_task_mgmt_completion,
task->scsi.cb_event = spdk_event_allocate(spdk_app_get_current_core(), process_task_mgmt_completion,
conn, task, NULL);
spdk_scsi_dev_queue_mgmt_task(conn->dev, &task->scsi);
}

View File

@ -59,10 +59,7 @@
#include <sys/disklabel.h>
#endif
#include <rte_config.h>
#include <rte_cycles.h>
#include <rte_ring.h>
#include "spdk/event.h"
#include "spdk/log.h"
#include "spdk/conf.h"
#include "spdk/net.h"
@ -1090,7 +1087,7 @@ spdk_iscsi_tgt_node_cleanup_luns(struct spdk_iscsi_conn *conn,
task->scsi.lun = target->dev->lun[i];
task->scsi.function = SPDK_SCSI_TASK_FUNC_LUN_RESET;
task->scsi.cb_event = spdk_event_allocate(rte_lcore_id(),
task->scsi.cb_event = spdk_event_allocate(spdk_app_get_current_core(),
process_task_mgmt_completion, conn, task, NULL);
spdk_scsi_dev_queue_mgmt_task(target->dev, &task->scsi);
}