提交 3e6dc119 编写于 作者: M Michal Wilczynski 提交者: Tony Nguyen

ice: Fix check for weight and priority of a scheduling node

Currently checks for weight and priority ranges don't check incoming value
from the devlink. Instead it checks node current weight or priority. This
makes those checks useless.

Change range checks in ice_set_object_tx_priority() and
ice_set_object_tx_weight() to check against incoming priority an weight.

Fixes: 42c2eb6b ("ice: Implement devlink-rate API")
Signed-off-by: NMichal Wilczynski <michal.wilczynski@intel.com>
Acked-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Reviewed-by: NPaul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 2038cc59
...@@ -899,7 +899,7 @@ static int ice_set_object_tx_priority(struct ice_port_info *pi, struct ice_sched ...@@ -899,7 +899,7 @@ static int ice_set_object_tx_priority(struct ice_port_info *pi, struct ice_sched
{ {
int status; int status;
if (node->tx_priority >= 8) { if (priority >= 8) {
NL_SET_ERR_MSG_MOD(extack, "Priority should be less than 8"); NL_SET_ERR_MSG_MOD(extack, "Priority should be less than 8");
return -EINVAL; return -EINVAL;
} }
...@@ -929,7 +929,7 @@ static int ice_set_object_tx_weight(struct ice_port_info *pi, struct ice_sched_n ...@@ -929,7 +929,7 @@ static int ice_set_object_tx_weight(struct ice_port_info *pi, struct ice_sched_n
{ {
int status; int status;
if (node->tx_weight > 200 || node->tx_weight < 1) { if (weight > 200 || weight < 1) {
NL_SET_ERR_MSG_MOD(extack, "Weight must be between 1 and 200"); NL_SET_ERR_MSG_MOD(extack, "Weight must be between 1 and 200");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册