Content-Type: multipart/mixed; boundary="===============4381421833410163620==" MIME-Version: 1.0 From: Xiaochen Shen Subject: [Accel-config] [PATCH 4/5] accel-config: Add ats_disable unit test Date: Mon, 01 Feb 2021 15:48:17 +0800 Message-ID: <1612165698-8287-5-git-send-email-xiaochen.shen@intel.com> In-Reply-To: 1612165698-8287-1-git-send-email-xiaochen.shen@intel.com To: accel-config@lists.01.org List-ID: --===============4381421833410163620== 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 | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/test/dsa.c b/test/dsa.c index 70eda30..1844175 100644 --- a/test/dsa.c +++ b/test/dsa.c @@ -179,6 +179,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 b99ec44..6941025 100644 --- a/test/dsa.h +++ b/test/dsa.h @@ -85,6 +85,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 0ff43ca..708aeba 100644 --- a/test/libaccfg.c +++ b/test/libaccfg.c @@ -84,6 +84,7 @@ static struct wq_parameters wq00_param =3D { .threshold =3D 15, .max_batch_size =3D 1, .max_transfer_size =3D 1, + .ats_disable =3D 0, .mode =3D "shared", .type =3D "user", .name =3D "myapp1" @@ -96,6 +97,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" @@ -110,6 +112,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 "user", .name =3D "guest1" @@ -122,6 +125,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 "user", .name =3D "guest2" @@ -138,6 +142,7 @@ static struct wq_parameters wq12_param =3D { .threshold =3D 50, .max_batch_size =3D 1, .max_transfer_size =3D 1, + .ats_disable =3D 0, .mode =3D "shared", .type =3D "user", .name =3D "myapp3" @@ -151,6 +156,7 @@ static struct wq_parameters wq13_param =3D { .threshold =3D 50, .max_batch_size =3D 1, .max_transfer_size =3D 1, + .ats_disable =3D 0, .mode =3D "shared", .type =3D "user", .name =3D "myapp3" @@ -164,6 +170,7 @@ static struct wq_parameters wq14_param =3D { .threshold =3D 50, .max_batch_size =3D 1, .max_transfer_size =3D 1, + .ats_disable =3D 0, .mode =3D "shared", .type =3D "user", .name =3D "myapp3" @@ -352,6 +359,7 @@ static int config_wq(struct accfg_ctx *ctx, int dev_id,= int wq_id, accfg_wq_set_block_on_fault(wq, wq_param.block_on_fault); accfg_wq_set_max_batch_size(wq, wq_param.max_batch_size); accfg_wq_set_max_transfer_size(wq, wq_param.max_transfer_size); + accfg_wq_set_ats_disable(wq, wq_param.ats_disable); if (wq_param.threshold) accfg_wq_set_threshold(wq, wq_param.threshold); } @@ -413,6 +421,10 @@ static int check_wq(struct accfg_ctx *ctx, int dev_id,= int wq_id, 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; + } } } = -- = 1.8.3.1 --===============4381421833410163620==--