Do not set traffic_class if dev ver < 200
ramesh.thomas at intel.com
cover Do not set traffic_class if dev ver < 200
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
config-group command return error and load-config silently ignores setting of traffic_class attributes if device version < 0x200
Ramesh Thomas (2):
accel-config: Do not allow configuring traffic_class for dev ver <
0x200
accel-config: Ignore traffic_class in load-config if dev ver < 0x200
accfg/config.c | 21 +++++++++++++++++++-- accfg/config_attr.c | 9 +++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)
Signature · 1 line
2.26.3
ramesh.thomas at intel.com
PATCH 1/2 accel-config: Do not allow configuring traffic_class for dev ver < 0x200
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
Return error if config-group is called for traffic_class and device version < 0x200
--- accfg/config_attr.c | 9 +++++++++ 1 file changed, 9 insertions(+)
accfg/config_attr.c +9 -0
@@ -58,6 +58,15 @@ static int accel_config_parse_group_attribs(struct accfg_group *group, struct group_parameters *group_params) {int rc =0 ; +struct accfg_device *device; + + device =accfg_group_get_device (group); +if (accfg_device_get_version (device) <ACCFG_DEVICE_VERSION_2 && + (group_params->traffic_class_a !=INT_MAX || + group_params->traffic_class_b !=INT_MAX )) { +fprintf (stderr,"traffic-class cannot be configured\n" ); +return -EINVAL ; + }if (group_params->tokens_reserved !=UINT_MAX && group_params->tokens_reserved >=UCHAR_MAX ) {
Signature · 1 line
2.26.3
ramesh.thomas at intel.com
PATCH 2/2 accel-config: Ignore traffic_class in load-config if dev ver < 0x200
In reply to ramesh.thomas at intel.comFrom: Ramesh Thomas <ramesh.thomas(a)intel.com>
Silently ignore setting of traffic class if device version < 0x200
--- accfg/config.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
accfg/config.c +19 -2
@@ -69,6 +69,8 @@ static const struct device_set_table device_table[] = { { "token_limit", accfg_device_set_token_limit, NULL } }; +static bool is_group_traffic_class_writable (struct accfg_group *group, +int val);static bool is_group_token_attribs_writable (struct accfg_group *group,int val); static bool is_group_token_limit_writable(struct accfg_group *group,
@@ -82,9 +84,9 @@ static const struct group_set_table group_table[] = { {"tokens_allowed" , accfg_group_set_tokens_allowed,NULL , is_group_token_attribs_writable }, { "traffic_class_a", accfg_group_set_traffic_class_a, NULL, - is_group_token_attribs_writable }, + is_group_traffic_class_writable}, { "traffic_class_b", accfg_group_set_traffic_class_b, NULL, - is_group_token_attribs_writable }, + is_group_traffic_class_writable}, };static bool is_wq_threshold_writable (struct accfg_wq *wq,int val);
@@ -140,6 +142,21 @@ static bool is_group_token_attribs_writable(struct accfg_group *group,return true; } +static bool is_group_traffic_class_writable (struct accfg_group *group, +int val) +{ +struct accfg_device *device; + + device =accfg_group_get_device (group); +if (accfg_device_get_version (device) <ACCFG_DEVICE_VERSION_2 ) +return false; + +if (val ==-1 ) +return false; + +return true; +} +static bool is_wq_threshold_writable (struct accfg_wq *wq,int val) {if (accfg_wq_get_mode (wq) ==ACCFG_WQ_DEDICATED )
Signature · 1 line
2.26.3
Dave Jiang
Reviewed-by on the v1 seriesQuoted 5 lines · ramesh.thomas(a)intel.com
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
config-group command return error and load-config silently ignores setting of
traffic_classattributes if device version <0x200
Quoted 8 lines
Ramesh Thomas (2):
accel-config: Do not allow configuring traffic_class for dev ver < 0x200 accel-config: Ignore traffic_class in load-config if dev ver < 0x200accfg/config.c | 21 +++++++++++++++++++-- accfg/config_attr.c | 9 +++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)
for the series.