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:
paul Luse 2021-07-01 18:45:51 +00:00 committed by Jim Harris
parent 87435b7e53
commit fa9e703f4f
3 changed files with 13 additions and 13 deletions

View File

@ -775,7 +775,7 @@ _check_draining(void *arg)
unregister_worker(worker);
}
return -1;
return SPDK_POLLER_BUSY;
}
static int
@ -791,7 +791,7 @@ _worker_stop(void *arg)
worker->is_draining = true;
worker->is_draining_poller = SPDK_POLLER_REGISTER(_check_draining, worker, 0);
return 0;
return SPDK_POLLER_BUSY;
}
static void

View File

@ -752,7 +752,7 @@ migrate_poll_groups_by_rr(void *ctx)
spdk_thread_send_msg(pg->thread, migrate_poll_group_by_rr, NULL);
}
return 1;
return SPDK_POLLER_BUSY;
}
static void

View File

@ -133,7 +133,7 @@ hello_sock_close_timeout_poll(void *arg)
spdk_sock_group_close(&ctx->group);
spdk_app_stop(ctx->rc);
return 0;
return SPDK_POLLER_BUSY;
}
static int
@ -162,12 +162,12 @@ hello_sock_recv_poll(void *arg)
if (rc <= 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
return 0;
return SPDK_POLLER_IDLE;
}
SPDK_ERRLOG("spdk_sock_recv() failed, errno %d: %s\n",
errno, spdk_strerror(errno));
return -1;
return SPDK_POLLER_BUSY;
}
if (rc > 0) {
@ -176,7 +176,7 @@ hello_sock_recv_poll(void *arg)
printf("%s", buf_in);
}
return 0;
return SPDK_POLLER_BUSY;
}
static int
@ -193,7 +193,7 @@ hello_sock_writev_poll(void *arg)
/* EOF */
SPDK_NOTICELOG("Closing connection...\n");
hello_sock_quit(ctx, 0);
return 0;
return SPDK_POLLER_IDLE;
}
if (n > 0) {
/*
@ -206,7 +206,7 @@ hello_sock_writev_poll(void *arg)
ctx->bytes_out += rc;
}
}
return rc;
return rc > 0 ? SPDK_POLLER_BUSY : SPDK_POLLER_IDLE;
}
static int
@ -292,7 +292,7 @@ hello_sock_accept_poll(void *arg)
if (!g_is_running) {
hello_sock_quit(ctx, 0);
return 0;
return SPDK_POLLER_IDLE;
}
while (1) {
@ -302,7 +302,7 @@ hello_sock_accept_poll(void *arg)
if (rc < 0) {
SPDK_ERRLOG("Cannot get connection addresses\n");
spdk_sock_close(&ctx->sock);
return -1;
return SPDK_POLLER_IDLE;
}
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
@ -340,7 +340,7 @@ hello_sock_group_poll(void *arg)
SPDK_ERRLOG("Failed to poll sock_group=%p\n", ctx->group);
}
return -1;
return rc > 0 ? SPDK_POLLER_BUSY : SPDK_POLLER_IDLE;
}
static int