Fix some group id relaed issues
ramesh.thomas at intel.com
cover Fix some group id relaed issues
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
While configuring wqs and engines a special value of -1 for group id is used to dissociate those wqs and engines from groups. config-wq was not accepting -1 due to a bug and config-wq, though accepted it, printed an incorrect error message if invalid group id was passed.
Ramesh Thomas (2):
accel-config: Allow -1 wq->group-id
accel-config: Fix an incorrect error message related to
engine->group-id
accfg/config_attr.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.26.2
ramesh.thomas at intel.com
PATCH 1/2 accel-config: Allow -1 wq->group-id
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
-1 is a special value passed in config-wq to dissasociate the wq from groups
--- accfg/config_attr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
accfg/config_attr.c +6 -4
@@ -133,7 +133,8 @@ static int accel_config_parse_group_attribs(struct accfg_group *group,static int accel_config_parse_wq_attribs (struct accfg_device *device,struct accfg_wq *wq,struct wq_parameters *wq_params) { -unsigned int max_groups, max_wq_size, max_batch_size; +int max_groups; +unsigned int max_wq_size, max_batch_size;uint64_t max_transfer_size;int rc =0 ;
@@ -158,10 +159,11 @@ static int accel_config_parse_wq_attribs(struct accfg_device *device,return -EINVAL ; } -if (((unsigned int )wq_params->group_id >= max_groups) - && (wq_params->group_id !=INT_MAX )) { +if ((wq_params->group_id >= max_groups) && + (wq_params->group_id !=INT_MAX )) {fprintf (stderr, -"valid group_id should be 0 to %d\n" , max_groups-1 ); +"valid group id should be 0 to %d or -1 to dissociate the wq from groups\n" , + max_groups-1 );return -EINVAL ; }
Signature · 1 line
2.26.2
ramesh.thomas at intel.com
PATCH 2/2 accel-config: Fix an incorrect error message related to engine->group-id
In reply to ramesh.thomas at intel.comFrom: Ramesh Thomas <ramesh.thomas(a)intel.com>
Error message for invalid group ids incorrectly mentioned "engine id"
--- accfg/config_attr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
accfg/config_attr.c +3 -2
@@ -262,8 +262,9 @@ static int accel_config_parse_engine_attribs(struct accfg_device *device, max_groups =accfg_device_get_max_groups (device);if (engine_params->group_id >= max_groups) { -fprintf (stderr,"valid engine_id should be 0 to %d\n" , - max_groups -1 ); +fprintf (stderr, +"valid group id should be 0 to %d or -1 to dissociate from groups\n" , + max_groups -1 );return -EINVAL ; }
Signature · 1 line
2.26.2
Dave Jiang
Reviewed-by on the v1 seriesQuoted 7 lines · ramesh.thomas(a)intel.com
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
While configuring wqs and engines a special value of -1 for group id is used to dissociate those wqs and engines from groups. config-wq was not accepting -1 due to a bug and config-wq, though accepted it, printed an incorrect error message if invalid group id was passed.
Quoted 7 lines
Ramesh Thomas (2):
accel-config: Allow -1 wq->group-id accel-config: Fix an incorrect error message related to engine->group-idaccfg/config_attr.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)