accel-config: Fix a bug in list command
ramesh.thomas at intel.com
PATCH 1/1 accel-config: Fix a bug in list command
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
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 <ramesh.thomas(a)intel.com>
--- accfg/list.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
accfg/list.c +9 -7
@@ -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 =json_object_new_int (accfg_group_get_tokens_reserved (group)); -if (!jobj) - goto err;if (accfg_device_get_type (dev) !=ACCFG_DEVICE_IAX ) { + jobj =json_object_new_int (accfg_group_get_tokens_reserved (group)); +if (!jobj) + goto err; +json_object_object_add (jgroup,"tokens_reserved" , jobj); jobj =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 =json_object_new_int (accfg_group_get_traffic_class_a ( - group)); -if (!jobj) - goto err; } + jobj =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 =json_object_new_int (accfg_group_get_traffic_class_b ( group));
Signature · 1 line
2.26.3
Dave Jiang
Reviewed-by on v1 1/1Quoted 8 lines · ramesh.thomas(a)intel.com
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
The check for
ACCFG_DEVICE_IAXto avoid reading some dsa device specific attributes was misplaced. It excluded lines that should be included while included reading oftraffic_class_awhich should be read even for iax devices.Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
Reviewed-by Dave Jiang <dave.jiang(a)intel.com>
Quoted 42 lines
--- accfg/list.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)accfg/list.c +9
-7@@ -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 =json_object_new_int (accfg_group_get_tokens_reserved (group)); -if (!jobj) - goto err;if (accfg_device_get_type (dev) !=ACCFG_DEVICE_IAX ) { + jobj =json_object_new_int (accfg_group_get_tokens_reserved (group)); +if (!jobj) + goto err; +json_object_object_add (jgroup,"tokens_reserved" , jobj); jobj =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 =json_object_new_int (accfg_group_get_traffic_class_a ( - group)); -if (!jobj) - goto err; } + jobj =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 =json_object_new_int (accfg_group_get_traffic_class_b ( group));