From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DAE61F3FF8; Mon, 23 Jun 2025 21:16:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750713385; cv=none; b=EOnk0T6X9bqgr8xVlB/py/WDVMsdfrG/pPqUoHEgLz+geJpDWOalXPA0p40s2BxnCtid4poiSM/E7fa9oDigk3dPbJdvixZ9prcId4daXke2qcWNWa088W8mqAOjFtFFuBcL/whcenEf+m+StfhHwHpFQRadioDQU/oFE+Qu8hg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750713385; c=relaxed/simple; bh=uYHED6Q58Ms3z8cFG+iJ3rTOaN2R+rTzZM7Gpetv02Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lor9CpJh79FuvouBf2br+prXmZn0zmBOTmPL1qh0CDaXJp+TeFe5BM70KyAzQI0hgJAIIhv1DUOFv61v1DPLsCGFITbRj6QQIzYfN8A7nXGiv7rtCTgEB+un2p2f52s3fNQztw7zgmXoF3VPyYdZvhArnUVEKxDa5becOXB/wu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=D8DbOaha; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="D8DbOaha" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0A3EC4CEEA; Mon, 23 Jun 2025 21:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750713385; bh=uYHED6Q58Ms3z8cFG+iJ3rTOaN2R+rTzZM7Gpetv02Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8DbOahaWLqsIiPeZ0B5DWJLPM5MCi1UQ2STwPgTxcrdnIoayIb77ZIqx2S5DKFCV +ajDmQyc13muDurYkuE/8D7OkIYr5WaqMblUGkmDXNrzXeFWisbA7ZLkOZ1BUOQHzG rx/FVuQapXrffSbT0zE+mAZ6zZXN/7JIDJKWk7NM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dawid Osuchowski , Przemek Kitszel , Jacob Keller , Michal Kubiak , Simon Horman , Jesse Brandeburg , Tony Nguyen , Sasha Levin , Saritha Sanigani Subject: [PATCH 5.15 120/411] ice: create new Tx scheduler nodes for new queues only Date: Mon, 23 Jun 2025 15:04:24 +0200 Message-ID: <20250623130636.569406735@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130632.993849527@linuxfoundation.org> References: <20250623130632.993849527@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michal Kubiak [ Upstream commit 6fa2942578472c9cab13a8fc1dae0d830193e0a1 ] 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: 5513b920a4f7 ("ice: Update Tx scheduler tree for VSI multi-Tx queue support") Reviewed-by: Dawid Osuchowski Reviewed-by: Przemek Kitszel Reviewed-by: Jacob Keller Signed-off-by: Michal Kubiak Reviewed-by: Simon Horman Tested-by: Jesse Brandeburg Tested-by: Saritha Sanigani (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_sched.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c index 209e3a9d9b7ab..7446ef141410e 100644 --- a/drivers/net/ethernet/intel/ice/ice_sched.c +++ b/drivers/net/ethernet/intel/ice/ice_sched.c @@ -1576,16 +1576,16 @@ ice_sched_get_agg_node(struct ice_port_info *pi, struct ice_sched_node *tc_node, /** * ice_sched_calc_vsi_child_nodes - calculate number of VSI child nodes * @hw: pointer to the HW struct - * @num_qs: number of queues + * @num_new_qs: number of new queues that will be added to the tree * @num_nodes: num nodes array * * This function calculates the number of VSI child nodes based on the * number of queues. */ static void -ice_sched_calc_vsi_child_nodes(struct ice_hw *hw, u16 num_qs, u16 *num_nodes) +ice_sched_calc_vsi_child_nodes(struct ice_hw *hw, u16 num_new_qs, u16 *num_nodes) { - u16 num = num_qs; + u16 num = num_new_qs; u8 i, qgl, vsil; qgl = ice_sched_get_qgrp_layer(hw); @@ -1833,8 +1833,9 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle, return status; } - if (new_numqs) - ice_sched_calc_vsi_child_nodes(hw, new_numqs, new_num_nodes); + ice_sched_calc_vsi_child_nodes(hw, new_numqs - prev_numqs, + new_num_nodes); + /* Keep the max number of queue configuration all the time. Update the * tree only if number of queues > previous number of queues. This may * leave some extra nodes in the tree if number of queues < previous -- 2.39.5