From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 C346D28D841 for ; Fri, 9 May 2025 09:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746783788; cv=none; b=DxtwHNX6x1yI0DXay3xzQX9vvUuZnCkYFRrTtT8djF5v3ZRSjWbN87pQk8mJntuwkUI1kawVS1OoR2Vb8e6Hww8jU2GkzgAalcX8VpdYTZknSwl/UUe/LnewCdDMdojui2ZlY+hgY3/Ox1TT5BFFvZbugw+weALLptLf21A+ebU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746783788; c=relaxed/simple; bh=jEuc8oG1zoj+1FvFFD0JTEeZGZF00r/3x6Ok+rnihfY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jIGeGI7WMGZ7u5XYbRi6ZoM05Nz/2Q90TapIQ70c6GLGWnVzlnQt34ptyY/WIRWgh79UjzVgtCXmaoblitxApRNb+ThUsRLkHpzduCVrIUqyFECfd7KzUCPGZlTia/Iwqty2StjtyZP6hjLbA4XQaW3PQYVK718XqGuSUb+sgVQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hhz6zdkf; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hhz6zdkf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1746783787; x=1778319787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jEuc8oG1zoj+1FvFFD0JTEeZGZF00r/3x6Ok+rnihfY=; b=hhz6zdkfUlupF51gqGQxATw1yeXAMnyNrQaBYU8VDwkoNeJ9IR/F7ev9 2W13kIpZM/lBxZSa1E4+EnZTQKE00pb0/oZ5lwHdG8G3HiF1wjcyYRiSF RzAnqTjTCyqXXD1lkvRNnuBjO4X6C9MbRGC0bSmFvNO5gU4WjTF/IAJOF 6UQ46GGKPyYKaHqMWKRqKU9JQSgUrAiL6gqNN+/0Ji/uxxloy5Npt9K+B DL3+L0Unz+04jioQLJ+mC1WRdJ+uYrAaly9eZArc8qqLxdQESZGLKrw9g uGYanbEeGO9kzYVg3PrNFxKDQc9jnxuFAvTk0wRhc11WbXLICjjEmd/vW g==; X-CSE-ConnectionGUID: B02HADc8SF6tD5TfGCffkA== X-CSE-MsgGUID: Xc/cedX1Qlib4x7eVB6+OQ== X-IronPort-AV: E=McAfee;i="6700,10204,11427"; a="73985816" X-IronPort-AV: E=Sophos;i="6.15,274,1739865600"; d="scan'208";a="73985816" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2025 02:43:06 -0700 X-CSE-ConnectionGUID: ncLQPM5gRxCtkHp9FtUrOQ== X-CSE-MsgGUID: eNCRjWFgSTSRydL3xRRamg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,274,1739865600"; d="scan'208";a="136266716" Received: from gk3153-pr4-x299-22869.igk.intel.com (HELO localhost.igk.intel.com) ([10.102.21.130]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2025 02:43:03 -0700 From: Michal Kubiak To: intel-wired-lan@lists.osuosl.org Cc: maciej.fijalkowski@intel.com, aleksander.lobakin@intel.com, przemyslaw.kitszel@intel.com, dawid.osuchowski@linux.intel.com, jacob.e.keller@intel.com, jbrandeburg@cloudflare.com, netdev@vger.kernel.org, Michal Kubiak Subject: [PATCH iwl-net v2 2/3] ice: create new Tx scheduler nodes for new queues only Date: Fri, 9 May 2025 11:42:32 +0200 Message-ID: <20250509094233.197245-3-michal.kubiak@intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250509094233.197245-1-michal.kubiak@intel.com> References: <20250509094233.197245-1-michal.kubiak@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 6ca13c5dcb14..6524875b34d3 100644 --- a/drivers/net/ethernet/intel/ice/ice_sched.c +++ b/drivers/net/ethernet/intel/ice/ice_sched.c @@ -1604,16 +1604,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); @@ -1863,8 +1863,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.45.2