From ad3634af31a3bac54eb477930441c86dff3f1992 Mon Sep 17 00:00:00 2001 From: Curt Bruns Date: Wed, 4 May 2022 13:55:33 -0700 Subject: [PATCH] test: process admin completions during stub sleep The stub app runs during NVMe CI testing to minimize test time. It runs as the primary process and all other NVMe tests run as secondary processes and connect to the NVMe controller via shared memory. The issue is when there is an Async Event Notification, the secondary processes are not informed of the event because the stub app does not process admin completions and therefore they do not get added to other processes async event list. This change adds a call to process admin completions during the stub_sleep routine to cover this type of AEN case. A configurable sleep time was also added to allow the admin completion calls to occur more rapidly to help minimize test time, if needed. Signed-off-by: Curt Bruns Change-Id: I72d5afc511c4409ec4a03cd969dbbc0d7dd4f256 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12555 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- test/app/stub/stub.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/app/stub/stub.c b/test/app/stub/stub.c index 45ce0315c..130e288ba 100644 --- a/test/app/stub/stub.c +++ b/test/app/stub/stub.c @@ -40,6 +40,8 @@ static char g_path[256]; static struct spdk_poller *g_poller; +/* default sleep time in ms */ +static uint32_t g_sleep_time = 1000; struct ctrlr_entry { struct spdk_nvme_ctrlr *ctrlr; @@ -75,6 +77,7 @@ usage(char *executable_name) printf(" -n channel number of memory channels used for DPDK\n"); printf(" -p core main (primary) core for DPDK\n"); printf(" -s size memory size in MB for DPDK\n"); + printf(" -t msec sleep time (ms) between checking for admin completions\n"); printf(" -H show this usage\n"); } @@ -109,7 +112,12 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid, static int stub_sleep(void *arg) { - usleep(1000 * 1000); + struct ctrlr_entry *ctrlr_entry, *tmp; + + usleep(g_sleep_time * 1000); + TAILQ_FOREACH_SAFE(ctrlr_entry, &g_controllers, link, tmp) { + spdk_nvme_ctrlr_process_admin_completions(ctrlr_entry->ctrlr); + } return 0; } @@ -155,7 +163,7 @@ main(int argc, char **argv) opts.name = "stub"; opts.rpc_addr = NULL; - while ((ch = getopt(argc, argv, "i:m:n:p:s:H")) != -1) { + while ((ch = getopt(argc, argv, "i:m:n:p:s:t:H")) != -1) { if (ch == 'm') { opts.reactor_mask = optarg; } else if (ch == '?' || ch == 'H') { @@ -180,6 +188,9 @@ main(int argc, char **argv) case 's': opts.mem_size = val; break; + case 't': + g_sleep_time = val; + break; default: usage(argv[0]); exit(EXIT_FAILURE);