Content-Type: multipart/mixed; boundary="===============7218855281847015377==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH] accel-config: Do not set group traffic class for hw ver < 0x200 Date: Tue, 13 Jul 2021 08:24:34 -0700 Message-ID: <3ea26396-e504-95d2-5d9c-fbb7cca133e3@intel.com> In-Reply-To: 20210713024922.1084995-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============7218855281847015377== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 7/12/2021 7:49 PM, ramesh.thomas(a)intel.com wrote: > From: Ramesh Thomas > > A default value will be set by driver for hw versions < 0x200 > > Signed-off-by: Ramesh Thomas > --- > test/libaccfg.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/test/libaccfg.c b/test/libaccfg.c > index c37b71c..1d68781 100644 > --- a/test/libaccfg.c > +++ b/test/libaccfg.c > @@ -186,6 +186,10 @@ static int config_group(struct accfg_ctx *ctx, struc= t accfg_device *device, > group_param->tokens_allowed)); > SET_ERR(rc, accfg_group_set_use_token_limit(group, > group_param->use_token_limit)); > + > + if (accfg_device_get_version(device) < 0x200) Define magic number. Otherwise it looks fine. > + return rc; > + > SET_ERR(rc, accfg_group_set_traffic_class_a(group, > group_param->traffic_class_a)); > SET_ERR(rc, accfg_group_set_traffic_class_b(group, > @@ -217,6 +221,9 @@ static int check_group(struct accfg_ctx *ctx, struct = accfg_device *device, > return -EINVAL; > } > = > + if (accfg_device_get_version(device) < 0x200) > + return 0; > + > if (group_param->traffic_class_a !=3D > accfg_group_get_traffic_class_a(group)) { > fprintf(stderr, "%s failed on traffic_class_a\n", __func__); --===============7218855281847015377==--