Content-Type: multipart/mixed; boundary="===============7609799187451672557==" MIME-Version: 1.0 From: Xiaochen Shen Subject: [Accel-config] [PATCH v2 4/5] accel-config: Add ats_disable unit test Date: Fri, 09 Jul 2021 13:18:25 +0800 Message-ID: <1625807906-11570-5-git-send-email-xiaochen.shen@intel.com> In-Reply-To: 1625807906-11570-1-git-send-email-xiaochen.shen@intel.com To: accel-config@lists.01.org List-ID: --===============7609799187451672557== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Add ats_disable to wq parameters for config test. Signed-off-by: Xiaochen Shen --- test/dsa.c | 1 + test/dsa.h | 1 + test/libaccfg.c | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/test/dsa.c b/test/dsa.c index 65ce807..d8dd081 100644 --- a/test/dsa.c +++ b/test/dsa.c @@ -175,6 +175,7 @@ int dsa_alloc(struct dsa_context *ctx, int shared) ctx->bof =3D accfg_wq_get_block_on_fault(ctx->wq); ctx->wq_max_batch_size =3D accfg_wq_get_max_batch_size(ctx->wq); ctx->wq_max_xfer_size =3D accfg_wq_get_max_transfer_size(ctx->wq); + ctx->ats_disable =3D accfg_wq_get_ats_disable(ctx->wq); = ctx->max_batch_size =3D accfg_device_get_max_batch_size(dev); ctx->max_xfer_size =3D accfg_device_get_max_transfer_size(dev); diff --git a/test/dsa.h b/test/dsa.h index b301593..4dac780 100644 --- a/test/dsa.h +++ b/test/dsa.h @@ -86,6 +86,7 @@ struct dsa_context { int bof; unsigned int wq_max_batch_size; unsigned long wq_max_xfer_size; + int ats_disable; = int is_batch; union { diff --git a/test/libaccfg.c b/test/libaccfg.c index 93229c6..0dea193 100644 --- a/test/libaccfg.c +++ b/test/libaccfg.c @@ -68,6 +68,7 @@ static struct wq_parameters wq00_param =3D { .threshold =3D 15, .max_batch_size =3D 16, .max_transfer_size =3D 16, + .ats_disable =3D 0, .mode =3D "shared", .type =3D "user", .name =3D "myapp1" @@ -80,6 +81,7 @@ static struct wq_parameters wq01_param =3D { .block_on_fault =3D 0, .max_batch_size =3D (1 << 4), .max_transfer_size =3D (1l << 16), + .ats_disable =3D 0, .mode =3D "dedicated", .type =3D "user", .name =3D "myapp2" @@ -93,6 +95,7 @@ static struct wq_parameters wq02_param =3D { .threshold =3D 8, .max_batch_size =3D (1 << 8), .max_transfer_size =3D (1l << 30), + .ats_disable =3D 0, .mode =3D "shared", .type =3D "mdev", .name =3D "guest1" @@ -105,6 +108,7 @@ static struct wq_parameters wq03_param =3D { .block_on_fault =3D 0, .max_batch_size =3D (1 << 9), .max_transfer_size =3D (1l << 31), + .ats_disable =3D 0, .mode =3D "dedicated", .type =3D "mdev", .name =3D "guest2" @@ -243,6 +247,7 @@ static int config_wq(struct accfg_ctx *ctx, struct accf= g_device *device, SET_ERR(rc, accfg_wq_set_max_batch_size(wq, wq_param->max_batch_size)); SET_ERR(rc, accfg_wq_set_max_transfer_size(wq, wq_param->max_transfer_size)); + SET_ERR(rc, accfg_wq_set_ats_disable(wq, wq_param->ats_disable)); if (wq_param->threshold) SET_ERR(rc, accfg_wq_set_threshold(wq, wq_param->threshold)); = @@ -291,6 +296,10 @@ static int check_wq(struct accfg_ctx *ctx, struct accf= g_device *device, fprintf(stderr, "check wq failed on wq name\n"); return -EINVAL; } + if (wq_param->ats_disable !=3D accfg_wq_get_ats_disable(wq)) { + fprintf(stderr, "check_wq failed on ats_disable\n"); + return -EINVAL; + } = return 0; } -- = 1.8.3.1 --===============7609799187451672557==--