Content-Type: multipart/mixed; boundary="===============1168231248448188543==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH] accel-config: Fix a bug in list command Date: Fri, 30 Jul 2021 10:16:09 -0700 Message-ID: In-Reply-To: 20210730022256.1155602-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============1168231248448188543== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 7/29/2021 7:22 PM, ramesh.thomas(a)intel.com wrote: > From: Ramesh Thomas > > The check for ACCFG_DEVICE_IAX to avoid reading some dsa device specific > attributes was misplaced. It excluded lines that should be included while > included reading of traffic_class_a which should be read even for iax > devices. > > Signed-off-by: Ramesh Thomas Reviewed-by: Dave Jiang > --- > accfg/list.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/accfg/list.c b/accfg/list.c > index d03cf30..7fec813 100644 > --- a/accfg/list.c > +++ b/accfg/list.c > @@ -66,11 +66,12 @@ static struct json_object *group_to_json(struct accfg= _group *group, > goto err; > = > json_object_object_add(jgroup, "dev", jobj); > - jobj =3D json_object_new_int(accfg_group_get_tokens_reserved(group)); > - if (!jobj) > - goto err; > = > if (accfg_device_get_type(dev) !=3D ACCFG_DEVICE_IAX) { > + jobj =3D json_object_new_int(accfg_group_get_tokens_reserved(group)); > + if (!jobj) > + goto err; > + > json_object_object_add(jgroup, "tokens_reserved", jobj); > jobj =3D json_object_new_int(accfg_group_get_use_token_limit(group)); > if (!jobj) > @@ -82,12 +83,13 @@ static struct json_object *group_to_json(struct accfg= _group *group, > goto err; > = > json_object_object_add(jgroup, "tokens_allowed", jobj); > - jobj =3D json_object_new_int(accfg_group_get_traffic_class_a( > - group)); > - if (!jobj) > - goto err; > } > = > + jobj =3D json_object_new_int(accfg_group_get_traffic_class_a( > + group)); > + if (!jobj) > + goto err; > + > json_object_object_add(jgroup, "traffic_class_a", jobj); > jobj =3D json_object_new_int(accfg_group_get_traffic_class_b( > group)); --===============1168231248448188543==--