Skip to content

Commit 6fa2942

Browse files
michalQbanguy11
authored andcommitted
ice: create new Tx scheduler nodes for new queues only
The current implementation of the Tx scheduler tree attempts to create nodes for all Tx queues, ignoring the fact that some queues may already exist in the tree. For example, if the VSI already has 128 Tx queues and the user requests for 16 new queues, the Tx scheduler will compute the tree for 272 queues (128 existing queues + 144 new queues), instead of 144 queues (128 existing queues and 16 new queues). Fix that by modifying the node count calculation algorithm to skip the queues that already exist in the tree. Fixes: 5513b92 ("ice: Update Tx scheduler tree for VSI multi-Tx queue support") Reviewed-by: Dawid Osuchowski <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: Michal Kubiak <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Jesse Brandeburg <[email protected]> Tested-by: Saritha Sanigani <[email protected]> (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 0153f36 commit 6fa2942

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,16 +1604,16 @@ ice_sched_get_agg_node(struct ice_port_info *pi, struct ice_sched_node *tc_node,
16041604
/**
16051605
* ice_sched_calc_vsi_child_nodes - calculate number of VSI child nodes
16061606
* @hw: pointer to the HW struct
1607-
* @num_qs: number of queues
1607+
* @num_new_qs: number of new queues that will be added to the tree
16081608
* @num_nodes: num nodes array
16091609
*
16101610
* This function calculates the number of VSI child nodes based on the
16111611
* number of queues.
16121612
*/
16131613
static void
1614-
ice_sched_calc_vsi_child_nodes(struct ice_hw *hw, u16 num_qs, u16 *num_nodes)
1614+
ice_sched_calc_vsi_child_nodes(struct ice_hw *hw, u16 num_new_qs, u16 *num_nodes)
16151615
{
1616-
u16 num = num_qs;
1616+
u16 num = num_new_qs;
16171617
u8 i, qgl, vsil;
16181618

16191619
qgl = ice_sched_get_qgrp_layer(hw);
@@ -1863,8 +1863,9 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,
18631863
return status;
18641864
}
18651865

1866-
if (new_numqs)
1867-
ice_sched_calc_vsi_child_nodes(hw, new_numqs, new_num_nodes);
1866+
ice_sched_calc_vsi_child_nodes(hw, new_numqs - prev_numqs,
1867+
new_num_nodes);
1868+
18681869
/* Keep the max number of queue configuration all the time. Update the
18691870
* tree only if number of queues > previous number of queues. This may
18701871
* leave some extra nodes in the tree if number of queues < previous

0 commit comments

Comments
 (0)