Rather than computing from the number of HW layers the layer of the VSI,
we can instead just read that info from the VSI node itself. This allows
the layer to be changed at runtime.

Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
---
 drivers/net/ice/base/ice_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index f6dc5ae173..e398984bf2 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -1559,7 +1559,6 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 
vsi_handle, u8 tc,
        u16 max_children;
 
        qgrp_layer = ice_sched_get_qgrp_layer(pi->hw);
-       vsi_layer = ice_sched_get_vsi_layer(pi->hw);
        max_children = pi->hw->max_children[qgrp_layer];
 
        vsi_ctx = ice_get_vsi_ctx(pi->hw, vsi_handle);
@@ -1569,6 +1568,7 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 
vsi_handle, u8 tc,
        /* validate invalid VSI ID */
        if (!vsi_node)
                return NULL;
+       vsi_layer = vsi_node->tx_sched_layer;
 
        /* If the queue group and vsi layer are same then queues
         * are all attached directly to VSI
-- 
2.43.0

Reply via email to