accel-config: Do not set group traffic class for hw ver < 0x200
ramesh.thomas at intel.com
PATCH 1/1 accel-config: Do not set group traffic class for hw ver < 0x200
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
A default value will be set by driver for hw versions < 0x200
Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
--- test/libaccfg.c | 7 +++++++ 1 file changed, 7 insertions(+)
test/libaccfg.c +7 -0
@@ -186,6 +186,10 @@ static int config_group(struct accfg_ctx *ctx, struct 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 ) +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 !=accfg_group_get_traffic_class_a (group)) {fprintf (stderr,"%s failed on traffic_class_a\n" , __func__);
Signature · 1 line
2.26.3
Dave Jiang
Quoted 14 lines · ramesh.thomas(a)intel.com
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
A default value will be set by driver for hw versions <
0x200Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>--- test/libaccfg.c | 7 +++++++ 1 file changed, 7 insertions(+)test/libaccfg.c +0
-0
test/libaccfg.c static int config_group(struct accfg_ctx *ctx, struct accfg_device *device, · line 190
Quoted 5 lines
test/libaccfg.c +2
-0@@ -186,6 +186,10 @@ static int config_group(struct accfg_ctx *ctx, struct 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.
Quoted 15 lines
test/libaccfg.c +5
-0+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 !=accfg_group_get_traffic_class_a (group)) {fprintf (stderr,"%s failed on traffic_class_a\n" , __func__);