From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E912C3ABC9 for ; Thu, 15 May 2025 11:46:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B1E1040533; Thu, 15 May 2025 11:46:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Wl5woJ_8FCqj; Thu, 15 May 2025 11:46:51 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 250CF40509 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1747309611; bh=3t8AVsvUFFxY362jwv8uM+rFUxwTs0dmvxCxlUfsoOc=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FiKDhe99o2EqGgy99sVopi6ciyDd5dCuUkTMOPE/SpFnZdmx1U5uTWCuANItQjAa6 UMfFDyiv+YPMQRhPPfePNu5hzOQxWNJgBcNal9o9p4daLkeWLMZjh7yVcCPah7MK0N tbOQr8+0Mt4zAEopRKtn6ZHreATxD77H/hCs30gM5daaH4pZtsSkyj773GYsmgvW9v wAeNZAcFQpAoUj4SN4dvqe3Rs2qEDOh+QhYv3NdCnNjc2L0bkimy2HceOcHKkCj6ng aEI6dLS8zC/wQ/INhCcj0FC/U7qyri2exNQ99RLjyjTZ5W6PXIWGLGoXQH5qUA33uU /5ySu6dBb49yA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 250CF40509; Thu, 15 May 2025 11:46:51 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with ESMTP id 75672119 for ; Thu, 15 May 2025 11:46:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 66F1E80D75 for ; Thu, 15 May 2025 11:46:50 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rw073WL8LPeK for ; Thu, 15 May 2025 11:46:50 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2604:1380:45d1:ec00::3; helo=nyc.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org CDFDF80DEA DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CDFDF80DEA Received: from nyc.source.kernel.org (nyc.source.kernel.org [IPv6:2604:1380:45d1:ec00::3]) by smtp1.osuosl.org (Postfix) with ESMTPS id CDFDF80DEA for ; Thu, 15 May 2025 11:46:49 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id D4FE8A4E2D7; Thu, 15 May 2025 11:46:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB4AFC4CEE7; Thu, 15 May 2025 11:46:46 +0000 (UTC) Date: Thu, 15 May 2025 12:46:44 +0100 From: Simon Horman To: Michal Kubiak Cc: intel-wired-lan@lists.osuosl.org, 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 Message-ID: <20250515114644.GW3339421@horms.kernel.org> References: <20250513105529.241745-1-michal.kubiak@intel.com> <20250513105529.241745-4-michal.kubiak@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250513105529.241745-4-michal.kubiak@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747309608; bh=vxJ1lJpDsokpa+3eqqj8W/hw7hRFfKPXaUCS5sNBDaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S5GJrYui6Neqip2Tdi88KT8vqKUr/aOlX5Mr8fasyFqNbjETDWUYwIOA7LxlACcRU XprmjGC7X7/CLN/CjPZhoUce8NSMNl/ef9cqoVju34XMiYNOOTMCbI1Wh4aS7DF9WO Fxm98Kt9cBE1VsTJ515XLRwTgq69KlZTOW6JwYSRqgjPjD6wg3NdePNGnTHoECTROV aLkV4x/GAb2RPDve7E+bA/Py0uIRCw0ddS7sv4DhkDwTlXn1Mw6n5hHu8gcrXMOLyA 1fBs1VOzPa1tkPYCeNurRTVf1yqTTkth9t/ydkcsuWb9vciKZ1gaxT8bOOm8A/532+ CM/Klz9/j7nGA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=S5GJrYui Subject: Re: [Intel-wired-lan] [PATCH iwl-net v3 3/3] ice: fix rebuilding the Tx scheduler tree for large queue counts X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, May 13, 2025 at 12:55:29PM +0200, Michal Kubiak wrote: > The current implementation of the Tx scheduler allows the tree to be > rebuilt as the user adds more Tx queues to the VSI. In such a case, > additional child nodes are added to the tree to support the new number > of queues. > Unfortunately, this algorithm does not take into account that the limit > of the VSI support node may be exceeded, so an additional node in the > VSI layer may be required to handle all the requested queues. > > Such a scenario occurs when adding XDP Tx queues on machines with many > CPUs. Although the driver still respects the queue limit returned by > the FW, the Tx scheduler was unable to add those queues to its tree > and returned one of the errors below. > > Such a scenario occurs when adding XDP Tx queues on machines with many > CPUs (e.g. at least 321 CPUs, if there is already 128 Tx/Rx queue pairs). > Although the driver still respects the queue limit returned by the FW, > the Tx scheduler was unable to add those queues to its tree and returned > the following errors: > > Failed VSI LAN queue config for XDP, error: -5 > or: > Failed to set LAN Tx queue context, error: -22 > > Fix this problem by extending the tree rebuild algorithm to check if the > current VSI node can support the requested number of queues. If it > cannot, create as many additional VSI support nodes as necessary to > handle all the required Tx queues. Symmetrically, adjust the VSI node > removal algorithm to remove all nodes associated with the given VSI. > Also, make the search for the next free VSI node more restrictive. That is, > add queue group nodes only to the VSI support nodes that have a matching > VSI handle. > Finally, fix the comment describing the tree update algorithm to better > reflect the current scenario. > > Fixes: b0153fdd7e8a ("ice: update VSI config dynamically") > Reviewed-by: Dawid Osuchowski > Reviewed-by: Przemek Kitszel > Signed-off-by: Michal Kubiak Reviewed-by: Simon Horman 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 0D0092980B8 for ; Thu, 15 May 2025 11:46:48 +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=1747309609; cv=none; b=qeIExB8jJ/wvWLj3iPV0VcoHkEyrAqAuUZyI8mYh+MaVChjztZJODdCWpEzzetW1U+p8WjOOFb2qCvqOJFl2VigF178nOP7Npxt+4ELiOPrSsGAGoqtgGhfG5Et6VWyZjCiRDeMtOM5P211htp46zMmZC5HNc5B6ALjyFUXwtZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747309609; c=relaxed/simple; bh=vxJ1lJpDsokpa+3eqqj8W/hw7hRFfKPXaUCS5sNBDaw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bNZu6mDKMkUc4l/FAL5JCIdyER1P5Phj0zBrq7q4ljxZ/rZQO8ShcmAMVVIIMuK60FQjOkscrgCLX8EbtS2f23moQr0kXHUkDFB2HFe22xd15TOhy/BXk2GmVYlGj2SZLN92q3U3QKZSal2M46U7Z2tYD3f313B7CpFT+/l2plk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S5GJrYui; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S5GJrYui" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB4AFC4CEE7; Thu, 15 May 2025 11:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747309608; bh=vxJ1lJpDsokpa+3eqqj8W/hw7hRFfKPXaUCS5sNBDaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S5GJrYui6Neqip2Tdi88KT8vqKUr/aOlX5Mr8fasyFqNbjETDWUYwIOA7LxlACcRU XprmjGC7X7/CLN/CjPZhoUce8NSMNl/ef9cqoVju34XMiYNOOTMCbI1Wh4aS7DF9WO Fxm98Kt9cBE1VsTJ515XLRwTgq69KlZTOW6JwYSRqgjPjD6wg3NdePNGnTHoECTROV aLkV4x/GAb2RPDve7E+bA/Py0uIRCw0ddS7sv4DhkDwTlXn1Mw6n5hHu8gcrXMOLyA 1fBs1VOzPa1tkPYCeNurRTVf1yqTTkth9t/ydkcsuWb9vciKZ1gaxT8bOOm8A/532+ CM/Klz9/j7nGA== Date: Thu, 15 May 2025 12:46:44 +0100 From: Simon Horman To: Michal Kubiak Cc: intel-wired-lan@lists.osuosl.org, 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 Subject: Re: [PATCH iwl-net v3 3/3] ice: fix rebuilding the Tx scheduler tree for large queue counts Message-ID: <20250515114644.GW3339421@horms.kernel.org> References: <20250513105529.241745-1-michal.kubiak@intel.com> <20250513105529.241745-4-michal.kubiak@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250513105529.241745-4-michal.kubiak@intel.com> On Tue, May 13, 2025 at 12:55:29PM +0200, Michal Kubiak wrote: > The current implementation of the Tx scheduler allows the tree to be > rebuilt as the user adds more Tx queues to the VSI. In such a case, > additional child nodes are added to the tree to support the new number > of queues. > Unfortunately, this algorithm does not take into account that the limit > of the VSI support node may be exceeded, so an additional node in the > VSI layer may be required to handle all the requested queues. > > Such a scenario occurs when adding XDP Tx queues on machines with many > CPUs. Although the driver still respects the queue limit returned by > the FW, the Tx scheduler was unable to add those queues to its tree > and returned one of the errors below. > > Such a scenario occurs when adding XDP Tx queues on machines with many > CPUs (e.g. at least 321 CPUs, if there is already 128 Tx/Rx queue pairs). > Although the driver still respects the queue limit returned by the FW, > the Tx scheduler was unable to add those queues to its tree and returned > the following errors: > > Failed VSI LAN queue config for XDP, error: -5 > or: > Failed to set LAN Tx queue context, error: -22 > > Fix this problem by extending the tree rebuild algorithm to check if the > current VSI node can support the requested number of queues. If it > cannot, create as many additional VSI support nodes as necessary to > handle all the required Tx queues. Symmetrically, adjust the VSI node > removal algorithm to remove all nodes associated with the given VSI. > Also, make the search for the next free VSI node more restrictive. That is, > add queue group nodes only to the VSI support nodes that have a matching > VSI handle. > Finally, fix the comment describing the tree update algorithm to better > reflect the current scenario. > > Fixes: b0153fdd7e8a ("ice: update VSI config dynamically") > Reviewed-by: Dawid Osuchowski > Reviewed-by: Przemek Kitszel > Signed-off-by: Michal Kubiak Reviewed-by: Simon Horman