examples: update pollers to use the expected enum values
Some were still using 0, -1 and/or count values. Signed-off-by: paul Luse <paul.e.luse@intel.com> Change-Id: Ic161b5436c55f229f1f1a557d29e395bf8d4f660 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8584 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
4635f00e2d
commit
b7a23c80c1
@ -775,7 +775,7 @@ _check_draining(void *arg)
|
|||||||
unregister_worker(worker);
|
unregister_worker(worker);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return SPDK_POLLER_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -791,7 +791,7 @@ _worker_stop(void *arg)
|
|||||||
worker->is_draining = true;
|
worker->is_draining = true;
|
||||||
worker->is_draining_poller = SPDK_POLLER_REGISTER(_check_draining, worker, 0);
|
worker->is_draining_poller = SPDK_POLLER_REGISTER(_check_draining, worker, 0);
|
||||||
|
|
||||||
return 0;
|
return SPDK_POLLER_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -752,7 +752,7 @@ migrate_poll_groups_by_rr(void *ctx)
|
|||||||
spdk_thread_send_msg(pg->thread, migrate_poll_group_by_rr, NULL);
|
spdk_thread_send_msg(pg->thread, migrate_poll_group_by_rr, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return SPDK_POLLER_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -133,7 +133,7 @@ hello_sock_close_timeout_poll(void *arg)
|
|||||||
spdk_sock_group_close(&ctx->group);
|
spdk_sock_group_close(&ctx->group);
|
||||||
|
|
||||||
spdk_app_stop(ctx->rc);
|
spdk_app_stop(ctx->rc);
|
||||||
return 0;
|
return SPDK_POLLER_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -162,12 +162,12 @@ hello_sock_recv_poll(void *arg)
|
|||||||
|
|
||||||
if (rc <= 0) {
|
if (rc <= 0) {
|
||||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||||
return 0;
|
return SPDK_POLLER_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SPDK_ERRLOG("spdk_sock_recv() failed, errno %d: %s\n",
|
SPDK_ERRLOG("spdk_sock_recv() failed, errno %d: %s\n",
|
||||||
errno, spdk_strerror(errno));
|
errno, spdk_strerror(errno));
|
||||||
return -1;
|
return SPDK_POLLER_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
@ -176,7 +176,7 @@ hello_sock_recv_poll(void *arg)
|
|||||||
printf("%s", buf_in);
|
printf("%s", buf_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return SPDK_POLLER_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -193,7 +193,7 @@ hello_sock_writev_poll(void *arg)
|
|||||||
/* EOF */
|
/* EOF */
|
||||||
SPDK_NOTICELOG("Closing connection...\n");
|
SPDK_NOTICELOG("Closing connection...\n");
|
||||||
hello_sock_quit(ctx, 0);
|
hello_sock_quit(ctx, 0);
|
||||||
return 0;
|
return SPDK_POLLER_IDLE;
|
||||||
}
|
}
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
/*
|
/*
|
||||||
@ -206,7 +206,7 @@ hello_sock_writev_poll(void *arg)
|
|||||||
ctx->bytes_out += rc;
|
ctx->bytes_out += rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rc;
|
return rc > 0 ? SPDK_POLLER_BUSY : SPDK_POLLER_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -292,7 +292,7 @@ hello_sock_accept_poll(void *arg)
|
|||||||
|
|
||||||
if (!g_is_running) {
|
if (!g_is_running) {
|
||||||
hello_sock_quit(ctx, 0);
|
hello_sock_quit(ctx, 0);
|
||||||
return 0;
|
return SPDK_POLLER_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -302,7 +302,7 @@ hello_sock_accept_poll(void *arg)
|
|||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
SPDK_ERRLOG("Cannot get connection addresses\n");
|
SPDK_ERRLOG("Cannot get connection addresses\n");
|
||||||
spdk_sock_close(&ctx->sock);
|
spdk_sock_close(&ctx->sock);
|
||||||
return -1;
|
return SPDK_POLLER_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SPDK_NOTICELOG("Accepting a new connection from (%s, %hu) to (%s, %hu)\n",
|
SPDK_NOTICELOG("Accepting a new connection from (%s, %hu) to (%s, %hu)\n",
|
||||||
@ -326,7 +326,7 @@ hello_sock_accept_poll(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count > 0 ? SPDK_POLLER_BUSY : SPDK_POLLER_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -340,7 +340,7 @@ hello_sock_group_poll(void *arg)
|
|||||||
SPDK_ERRLOG("Failed to poll sock_group=%p\n", ctx->group);
|
SPDK_ERRLOG("Failed to poll sock_group=%p\n", ctx->group);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return rc > 0 ? SPDK_POLLER_BUSY : SPDK_POLLER_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user