Lines Matching refs:ctx

29 test_ctx_fail(struct test_ctx *ctx)  in test_ctx_fail()  argument
31 ctx->status = 1; in test_ctx_fail()
32 ctx->state = TEST_STATE_DONE; in test_ctx_fail()
40 struct test_ctx *ctx = arg; in fill_cb() local
45 test_ctx_fail(ctx); in fill_cb()
50 if (memcmp(ctx->buf1, expected, TEST_XFER_SIZE) != 0) { in fill_cb()
52 test_ctx_fail(ctx); in fill_cb()
56 ctx->state = TEST_STATE_COPY; in fill_cb()
58 process_accel(ctx); in fill_cb()
64 struct test_ctx *ctx = arg; in copy_cb() local
68 test_ctx_fail(ctx); in copy_cb()
71 if (memcmp(ctx->buf1, ctx->buf2, TEST_XFER_SIZE) != 0) { in copy_cb()
73 test_ctx_fail(ctx); in copy_cb()
77 ctx->state = TEST_STATE_COMPARE; in copy_cb()
79 process_accel(ctx); in copy_cb()
85 struct test_ctx *ctx = arg; in compare_cb() local
89 test_ctx_fail(ctx); in compare_cb()
92 if (memcmp(ctx->buf1, ctx->buf2, TEST_XFER_SIZE) != 0) { in compare_cb()
94 test_ctx_fail(ctx); in compare_cb()
98 ctx->state = TEST_STATE_DONE; in compare_cb()
100 process_accel(ctx); in compare_cb()
107 struct test_ctx *ctx = _ctx; in process_accel() local
111 prev_state = ctx->state; in process_accel()
113 switch (ctx->state) { in process_accel()
115 memset(ctx->buf1, 0, sizeof(ctx->buf1)); in process_accel()
116 memset(ctx->buf2, 0, sizeof(ctx->buf2)); in process_accel()
117 ctx->state = TEST_STATE_WAIT_COMPLETION; in process_accel()
119 rc = spdk_accel_submit_fill(ctx->ch, ctx->buf1, FILL_PATTERN, in process_accel()
120 TEST_XFER_SIZE, fill_cb, ctx); in process_accel()
123 test_ctx_fail(ctx); in process_accel()
127 ctx->state = TEST_STATE_WAIT_COMPLETION; in process_accel()
129 rc = spdk_accel_submit_copy(ctx->ch, ctx->buf1, ctx->buf2, in process_accel()
130 TEST_XFER_SIZE, copy_cb, ctx); in process_accel()
133 test_ctx_fail(ctx); in process_accel()
137 ctx->state = TEST_STATE_WAIT_COMPLETION; in process_accel()
139 rc = spdk_accel_submit_compare(ctx->ch, ctx->buf1, ctx->buf2, in process_accel()
140 TEST_XFER_SIZE, compare_cb, ctx); in process_accel()
143 test_ctx_fail(ctx); in process_accel()
149 spdk_put_io_channel(ctx->ch); in process_accel()
150 spdk_app_stop(ctx->status); in process_accel()
153 } while (ctx->state != prev_state); in process_accel()
159 struct test_ctx *ctx = _ctx; in start_accel() local
161 ctx->ch = spdk_accel_get_io_channel(); in start_accel()
162 if (ctx->ch == NULL) { in start_accel()
168 process_accel(ctx); in start_accel()
176 struct test_ctx ctx = {.state = TEST_STATE_FILL, .status = 0}; in main() local
191 rc = spdk_app_start(&opts, start_accel, &ctx); in main()