Content-Type: multipart/mixed; boundary="===============7781164074624218888==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH] accel-config: Do not fail shared wq tests if platform does not support shared wqs Date: Wed, 11 Aug 2021 08:15:11 -0700 Message-ID: <9f0b68d4-c3fc-61ed-ef16-8fdfc33a7478@intel.com> In-Reply-To: 20210811025544.1182713-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============7781164074624218888== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 8/10/2021 7:55 PM, ramesh.thomas(a)intel.com wrote: > From: Ramesh Thomas > > If shared wq is not supported by platform use dedicated mode to avoid > failing batch configuration tests > > Signed-off-by: Ramesh Thomas Reviewed-by: Dave Jiang > --- > test/libaccfg.c | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/test/libaccfg.c b/test/libaccfg.c > index 516adbc..a982344 100644 > --- a/test/libaccfg.c > +++ b/test/libaccfg.c > @@ -244,7 +244,13 @@ static int config_wq(struct accfg_ctx *ctx, struct a= ccfg_device *device, > { > int rc =3D 0; > = > - SET_ERR(rc, accfg_wq_set_str_mode(wq, wq_param->mode)); > + rc =3D accfg_wq_set_str_mode(wq, wq_param->mode); > + if (rc =3D=3D -EINVAL) { > + fprintf(stderr, "%s shared wq not supported, configuring as dedicated\= n", > + __func__); > + rc =3D accfg_wq_set_str_mode(wq, "dedicated"); > + } > + > SET_ERR(rc, accfg_wq_set_str_type(wq, wq_param->type)); > SET_ERR(rc, accfg_wq_set_str_name(wq, wq_param->name)); > SET_ERR(rc, accfg_wq_set_size(wq, wq_param->wq_size)); > @@ -254,7 +260,7 @@ static int config_wq(struct accfg_ctx *ctx, struct ac= cfg_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)); > - if (wq_param->threshold) > + if (wq_param->threshold && accfg_wq_get_mode(wq) =3D=3D ACCFG_WQ_SHARED) > SET_ERR(rc, accfg_wq_set_threshold(wq, wq_param->threshold)); > = > SET_ERR(rc, accfg_wq_set_ats_disable(wq, wq_param->ats_disable)); > @@ -288,7 +294,7 @@ static int check_wq(struct accfg_ctx *ctx, struct acc= fg_device *device, > fprintf(stderr, "%s failed on block_on_fault\n", __func__); > return -EINVAL; > } > - if (wq_param->threshold !=3D > + if (accfg_wq_get_mode(wq) =3D=3D ACCFG_WQ_SHARED && wq_param->threshold= !=3D > (unsigned int)accfg_wq_get_threshold(wq)) { > fprintf(stderr, "%s failed on threshold\n", __func__); > return -EINVAL; > @@ -815,6 +821,11 @@ static int test_mdev_1swq(struct accfg_ctx *ctx) > if (rc) > return rc; > = > + if (accfg_wq_get_mode(test_ctx.wq[2]) !=3D ACCFG_WQ_SHARED) { > + fprintf(stderr, "%s shared wq not supported\n", __func__); > + return -EOPNOTSUPP; > + } > + > rc =3D set_mdev_type(ctx, test_ctx.wq[2], test_ctx.wq_param[2]); > if (rc) > return rc; --===============7781164074624218888==--