Skip to content

Commit 3e6dc11

Browse files
mwilczyanguy11
authored andcommitted
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: 42c2eb6 ("ice: Implement devlink-rate API") Signed-off-by: Michal Wilczynski <[email protected]> Acked-by: Jesse Brandeburg <[email protected]> Reviewed-by: Paul Menzel <[email protected]> Tested-by: Gurucharan G <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 2038cc5 commit 3e6dc11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/intel/ice/ice_devlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static int ice_set_object_tx_priority(struct ice_port_info *pi, struct ice_sched
899899
{
900900
int status;
901901

902-
if (node->tx_priority >= 8) {
902+
if (priority >= 8) {
903903
NL_SET_ERR_MSG_MOD(extack, "Priority should be less than 8");
904904
return -EINVAL;
905905
}
@@ -929,7 +929,7 @@ static int ice_set_object_tx_weight(struct ice_port_info *pi, struct ice_sched_n
929929
{
930930
int status;
931931

932-
if (node->tx_weight > 200 || node->tx_weight < 1) {
932+
if (weight > 200 || weight < 1) {
933933
NL_SET_ERR_MSG_MOD(extack, "Weight must be between 1 and 200");
934934
return -EINVAL;
935935
}

0 commit comments

Comments
 (0)