event: remove 'complete' parameter from poller_register
The spdk_poller_register() function provides a way to pass an event to call once the poller is registered, but it is always NULL in the current code base. Change-Id: I459bf40ae4d050589577d113b7984f1563aaa9cc Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
7b01af8fd2
commit
2931a3efef
@ -202,7 +202,7 @@ _nvmf_tgt_start_subsystem(struct spdk_event *event)
|
||||
}
|
||||
}
|
||||
|
||||
spdk_poller_register(&app_subsys->poller, subsystem_poll, app_subsys, lcore, NULL, 0);
|
||||
spdk_poller_register(&app_subsys->poller, subsystem_poll, app_subsys, lcore, 0);
|
||||
}
|
||||
|
||||
void
|
||||
@ -339,7 +339,7 @@ spdk_nvmf_startup(spdk_event_t event)
|
||||
}
|
||||
|
||||
spdk_poller_register(&g_acceptor_poller, acceptor_poll, NULL,
|
||||
g_spdk_nvmf_tgt_conf.acceptor_lcore, NULL,
|
||||
g_spdk_nvmf_tgt_conf.acceptor_lcore,
|
||||
g_spdk_nvmf_tgt_conf.acceptor_poll_rate);
|
||||
|
||||
SPDK_NOTICELOG("Acceptor running on core %u on socket %u\n", g_spdk_nvmf_tgt_conf.acceptor_lcore,
|
||||
|
@ -235,7 +235,6 @@ void spdk_poller_register(struct spdk_poller **ppoller,
|
||||
spdk_poller_fn fn,
|
||||
void *arg,
|
||||
uint32_t lcore,
|
||||
struct spdk_event *complete,
|
||||
uint64_t period_microseconds);
|
||||
|
||||
/**
|
||||
|
@ -306,7 +306,7 @@ blockdev_aio_create_cb(void *io_device, uint32_t priority, void *ctx_buf, void *
|
||||
}
|
||||
|
||||
spdk_poller_register(&ch->poller, blockdev_aio_poll, ch,
|
||||
spdk_app_get_current_core(), NULL, 0);
|
||||
spdk_app_get_current_core(), 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ blockdev_nvme_create_cb(void *io_device, uint32_t priority, void *ctx_buf, void
|
||||
}
|
||||
|
||||
spdk_poller_register(&ch->poller, blockdev_nvme_poll, ch->qpair,
|
||||
spdk_app_get_current_core(), NULL, 0);
|
||||
spdk_app_get_current_core(), 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -449,7 +449,7 @@ blockdev_rbd_create_cb(void *io_device, uint32_t priority,
|
||||
}
|
||||
|
||||
spdk_poller_register(&ch->poller, blockdev_rbd_io_poll, ch,
|
||||
spdk_app_get_current_core(), NULL, 0);
|
||||
spdk_app_get_current_core(), 0);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -207,7 +207,7 @@ ioat_create_cb(void *io_device, uint32_t priority, void *ctx_buf, void *unique_c
|
||||
ch->ioat_dev = ioat_dev;
|
||||
ch->ioat_ch = ioat_dev->ioat;
|
||||
spdk_poller_register(&ch->poller, ioat_poll, ch->ioat_ch,
|
||||
spdk_app_get_current_core(), NULL, 0);
|
||||
spdk_app_get_current_core(), 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -625,18 +625,13 @@ spdk_reactors_fini(void)
|
||||
}
|
||||
|
||||
static void
|
||||
_spdk_poller_register(struct spdk_reactor *reactor, struct spdk_poller *poller,
|
||||
struct spdk_event *next)
|
||||
_spdk_poller_register(struct spdk_reactor *reactor, struct spdk_poller *poller)
|
||||
{
|
||||
if (poller->period_ticks) {
|
||||
spdk_poller_insert_timer(reactor, poller, spdk_get_ticks());
|
||||
} else {
|
||||
TAILQ_INSERT_TAIL(&reactor->active_pollers, poller, tailq);
|
||||
}
|
||||
|
||||
if (next) {
|
||||
spdk_event_call(next);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -644,14 +639,13 @@ _spdk_event_add_poller(spdk_event_t event)
|
||||
{
|
||||
struct spdk_reactor *reactor = spdk_event_get_arg1(event);
|
||||
struct spdk_poller *poller = spdk_event_get_arg2(event);
|
||||
struct spdk_event *next = event->next;
|
||||
|
||||
_spdk_poller_register(reactor, poller, next);
|
||||
_spdk_poller_register(reactor, poller);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg,
|
||||
uint32_t lcore, struct spdk_event *complete, uint64_t period_microseconds)
|
||||
uint32_t lcore, uint64_t period_microseconds)
|
||||
{
|
||||
struct spdk_poller *poller;
|
||||
struct spdk_reactor *reactor;
|
||||
@ -686,14 +680,14 @@ spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg,
|
||||
* The poller is registered to run on the current core, so call the add function
|
||||
* directly.
|
||||
*/
|
||||
_spdk_poller_register(reactor, poller, complete);
|
||||
_spdk_poller_register(reactor, poller);
|
||||
} else {
|
||||
/*
|
||||
* The poller is registered to run on a different core.
|
||||
* Schedule an event to run on the poller's core that will add the poller.
|
||||
*/
|
||||
spdk_event_call(spdk_event_allocate(lcore, _spdk_event_add_poller, reactor, poller,
|
||||
complete));
|
||||
NULL));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ void
|
||||
spdk_iscsi_acceptor_start(void)
|
||||
{
|
||||
spdk_poller_register(&g_acceptor_poller, spdk_acceptor, &g_spdk_iscsi, spdk_app_get_current_core(),
|
||||
NULL, ACCEPT_TIMEOUT_US);
|
||||
ACCEPT_TIMEOUT_US);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -286,7 +286,7 @@ int spdk_initialize_iscsi_conns(void)
|
||||
}
|
||||
|
||||
spdk_poller_register(&g_idle_conn_poller, spdk_iscsi_conn_idle_do_work, NULL,
|
||||
rte_get_master_lcore(), NULL, 0);
|
||||
rte_get_master_lcore(), 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -408,7 +408,7 @@ error_return:
|
||||
spdk_net_framework_clear_socket_association(conn->sock);
|
||||
__sync_fetch_and_add(&g_num_connections[conn->lcore], 1);
|
||||
spdk_poller_register(&conn->poller, spdk_iscsi_conn_login_do_work, conn,
|
||||
conn->lcore, NULL, 0);
|
||||
conn->lcore, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -609,7 +609,7 @@ void spdk_iscsi_conn_destruct(struct spdk_iscsi_conn *conn)
|
||||
if (rc < 0) {
|
||||
/* The connection cannot be freed yet. Check back later. */
|
||||
spdk_poller_register(&conn->shutdown_timer, _spdk_iscsi_conn_check_shutdown, conn,
|
||||
spdk_app_get_current_core(), NULL, 1000);
|
||||
spdk_app_get_current_core(), 1000);
|
||||
} else {
|
||||
spdk_iscsi_conn_stop_poller(conn, _spdk_iscsi_conn_free, spdk_app_get_current_core());
|
||||
}
|
||||
@ -741,7 +741,7 @@ void spdk_shutdown_iscsi_conns(void)
|
||||
|
||||
pthread_mutex_unlock(&g_conns_mutex);
|
||||
spdk_poller_register(&g_shutdown_timer, spdk_iscsi_conn_check_shutdown, NULL,
|
||||
rte_get_master_lcore(), NULL, 1000);
|
||||
rte_get_master_lcore(), 1000);
|
||||
}
|
||||
|
||||
int
|
||||
@ -1299,7 +1299,7 @@ spdk_iscsi_conn_full_feature_migrate(struct spdk_event *event)
|
||||
/* 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,
|
||||
conn->lcore, NULL, 0);
|
||||
conn->lcore, 0);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1518,7 +1518,7 @@ spdk_iscsi_conn_logout(struct spdk_iscsi_conn *conn)
|
||||
{
|
||||
conn->state = ISCSI_CONN_STATE_LOGGED_OUT;
|
||||
spdk_poller_register(&conn->logout_timer, logout_timeout, conn, spdk_app_get_current_core(),
|
||||
NULL, ISCSI_LOGOUT_TIMEOUT * 1000000);
|
||||
ISCSI_LOGOUT_TIMEOUT * 1000000);
|
||||
}
|
||||
|
||||
SPDK_TRACE_REGISTER_FN(iscsi_conn_trace)
|
||||
|
@ -227,7 +227,7 @@ spdk_rpc_setup(void *arg)
|
||||
|
||||
/* Register the periodic rpc_server_do_work */
|
||||
spdk_poller_register(&g_rpc_poller, spdk_rpc_server_do_work, NULL, spdk_app_get_current_core(),
|
||||
NULL, RPC_SELECT_INTERVAL);
|
||||
RPC_SELECT_INTERVAL);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -239,8 +239,7 @@ spdk_rpc_initialize(void)
|
||||
* when the SPDK application has finished initialization and ready for logins
|
||||
* or RPC commands.
|
||||
*/
|
||||
spdk_poller_register(&g_rpc_poller, spdk_rpc_setup, NULL, spdk_app_get_current_core(),
|
||||
NULL, 0);
|
||||
spdk_poller_register(&g_rpc_poller, spdk_rpc_setup, NULL, spdk_app_get_current_core(), 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ reset_cb(spdk_event_t event)
|
||||
rte_mempool_put(task_pool, task);
|
||||
|
||||
spdk_poller_register(&target->reset_timer, reset_target, target, target->lcore,
|
||||
NULL, 10 * 1000000);
|
||||
10 * 1000000);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -410,11 +410,11 @@ bdevperf_submit_on_core(spdk_event_t event)
|
||||
target->ch = spdk_bdev_get_io_channel(target->bdev, SPDK_IO_PRIORITY_DEFAULT);
|
||||
|
||||
/* Start a timer to stop this I/O chain when the run is over */
|
||||
spdk_poller_register(&target->run_timer, end_target, target, target->lcore, NULL,
|
||||
spdk_poller_register(&target->run_timer, end_target, target, target->lcore,
|
||||
g_time_in_sec * 1000000);
|
||||
if (g_reset) {
|
||||
spdk_poller_register(&target->reset_timer, reset_target, target,
|
||||
target->lcore, NULL, 10 * 1000000);
|
||||
target->lcore, 10 * 1000000);
|
||||
}
|
||||
bdevperf_submit_io(target, g_queue_depth);
|
||||
target = target->next;
|
||||
@ -493,7 +493,7 @@ bdevperf_run(spdk_event_t evt)
|
||||
/* Start a timer to dump performance numbers */
|
||||
if (g_show_performance_real_time) {
|
||||
spdk_poller_register(&g_perf_timer, performance_statistics_thread, NULL,
|
||||
spdk_app_get_current_core(), NULL, 1000000);
|
||||
spdk_app_get_current_core(), 1000000);
|
||||
}
|
||||
|
||||
/* Send events to start all I/O */
|
||||
|
@ -79,14 +79,14 @@ test_start(spdk_event_t evt)
|
||||
printf("test_start\n");
|
||||
|
||||
/* Register a poller that will stop the test after the time has elapsed. */
|
||||
spdk_poller_register(&test_end_poller, test_end, NULL, 0, NULL, g_time_in_sec * 1000000ULL);
|
||||
spdk_poller_register(&test_end_poller, test_end, NULL, 0, g_time_in_sec * 1000000ULL);
|
||||
|
||||
spdk_poller_register(&poller_100ms, tick, (void *)100, 0, NULL, 100000);
|
||||
spdk_poller_register(&poller_250ms, tick, (void *)250, 0, NULL, 250000);
|
||||
spdk_poller_register(&poller_500ms, tick, (void *)500, 0, NULL, 500000);
|
||||
spdk_poller_register(&poller_oneshot, oneshot, NULL, 0, NULL, 0);
|
||||
spdk_poller_register(&poller_100ms, tick, (void *)100, 0, 100000);
|
||||
spdk_poller_register(&poller_250ms, tick, (void *)250, 0, 250000);
|
||||
spdk_poller_register(&poller_500ms, tick, (void *)500, 0, 500000);
|
||||
spdk_poller_register(&poller_oneshot, oneshot, NULL, 0, 0);
|
||||
|
||||
spdk_poller_register(&poller_unregister, nop, NULL, 0, NULL, 0);
|
||||
spdk_poller_register(&poller_unregister, nop, NULL, 0, 0);
|
||||
spdk_poller_unregister(&poller_unregister, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user