From patchwork Wed Dec 6 20:19:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 1872955 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=yMPp0ay+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Slpdw5Vykz23nW for ; Thu, 7 Dec 2023 07:19:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BD03F60B38; Wed, 6 Dec 2023 20:19:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BD03F60B38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1701893954; bh=XFZv9Dq8g1Uvd/n8iDQzAdfr+yxuC1Mom0GaZR3uvqA=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=yMPp0ay+iJBCSuR8/AG9GSx6a4wmKFpadQY5UzCExEy5TXIIu6YZPSzkffHm+m0rW 6irwRRIwxhLTLyWvi0+57Nkw85Dh/1RZO5HPvsweLHYvNpZONBkNk5cqnThQeS/WOm rzgYLOjk3a68hREYiWw6i6AFXlf1VaAGBuGaYFT+5vqImZLOuTDQWe0u0WNmNycbfx Jvc/aDfxViR579XsBzmHQQNkeXIPeNAiZ4bNQouJuXkq/H+/IpaQiLF1/CPVe2mSyz 3bq01EevvYRUqPm1imqtTqGpNpH6yXVgnA0DNyYI0pyDoL8DkkVR9gu6wPONrwUMSE hYzF2L8U3JEbg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zWpyVQPPD9Ep; Wed, 6 Dec 2023 20:19:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id B160960BE1; Wed, 6 Dec 2023 20:19:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B160960BE1 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0F6801BF82C for ; Wed, 6 Dec 2023 20:19:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DAE6541DFA for ; Wed, 6 Dec 2023 20:19:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DAE6541DFA X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rJjo7kqDwWMg for ; Wed, 6 Dec 2023 20:19:11 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1CA78408A0 for ; Wed, 6 Dec 2023 20:19:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 1CA78408A0 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="393849135" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="393849135" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 12:19:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="771422076" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="771422076" Received: from jekeller-desk.amr.corp.intel.com (HELO jekeller-desk.jekeller.internal) ([10.166.241.1]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 12:19:09 -0800 From: Jacob Keller To: Intel Wired LAN , netdev@vger.kernel.org Date: Wed, 6 Dec 2023 12:19:05 -0800 Message-ID: <20231206201905.846723-1-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701893951; x=1733429951; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NplvjNbEFM1WsC4sfnvrDmZLgEk7qco917sLaQ7BfYQ=; b=ZrwLSdAEUE9l1AifldqDesYFvs8n+YP278OSZEwx23sYW89Ds7zshW3s C8WZlTHb49+bWtH/apQ3fonHVdJ4Qr9xs5g/zMhUqEGIOvvxF+f+o2ORE /2XH8vNhCUg9Wc25C5o3EuMwMgcosU+jQd0leWz6kiCljhrB1hxzQdarB 0Z3oPN1RQ5Pv9ZC4mK14esDNC4py8Wrqfl88VkD67ONFqlJutP2WHvgAT R3+BiwP+fMXjOd15K/fRob7VQtSfEZe7UQK0I56vfwGdxjGr1jWgK1jlQ yMluC2vjfQ1IUFFaDB1DEvD85+0A3vzIVjAeZz85Ylcv0uIQsgpAmyC4O A==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZrwLSdAE Subject: [Intel-wired-lan] [PATCH iwl-net] ice: stop trashing VF VSI aggregator node ID information X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jacob Keller , Przemek Kitszel , Anthony Nguyen Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" When creating new VSIs, they are assigned into an aggregator node in the scheduler tree. Information about which aggregator node a VSI is assigned into is maintained by the vsi->agg_node structure. In ice_vsi_decfg(), this information is being destroyed, by overwriting the valid flag and the agg_id field to zero. For VF VSIs, this breaks the aggregator node configuration replay, which depends on this information. This results in VFs being inserted into the default aggregator node. The resulting configuration will have unexpected Tx bandwidth sharing behavior. This was broken by commit 6624e780a577 ("ice: split ice_vsi_setup into smaller functions"), which added the block to reset the agg_node data. The vsi->agg_node structure is not managed by the scheduler code, but is instead a wrapper around an aggregator node ID that is tracked at the VSI layer. Its been around for a long time, and its primary purpose was for handling VFs. The SR-IOV VF reset flow does not make use of the standard VSI rebuild/replay logic, and uses vsi->agg_node as part of its handling to rebuild the aggregator node configuration. The logic for aggregator nodes stretches back to early ice driver code from commit b126bd6bcd67 ("ice: create scheduler aggregator node config and move VSIs") The logic in ice_vsi_decfg() which trashes the ice_agg_node data is clearly wrong. It destroys information that is necessary for handling VF reset,. It is also not the correct way to actually remove a VSI from an aggregator node. For that, we need to implement logic in the scheduler code. Further, non-VF VSIs properly replay their aggregator configuration using existing scheduler replay logic. To fix the VF replay logic, remove this broken aggregator node cleanup logic. This is the simplest way to immediately fix this. This ensures that VFs will have proper aggregate configuration after a reset. This is especially important since VFs often perform resets as part of their reconfiguration flows. Without fixing this, VFs will be placed in the default aggregator node and Tx bandwidth will not be shared in the expected and configured manner. Fixes: 6624e780a577 ("ice: split ice_vsi_setup into smaller functions") Signed-off-by: Jacob Keller Reviewed-by: Przemek Kitszel Reviewed-by: Simon Horman Tested-by: Rafal Romanowski --- This is the simplest fix to resolve the aggregator node problem. However, I think we should clean this up properly. I don't know why the VF VSIs have their own custom code for replaying aggregator configuration. I also think its odd that there is both structures to track aggregator information in ice_sched.c, but we use a separate structure in ice.h for the ice_vsi structure. I plan to investigate this and clean it up in next. However, I wanted to get a smaller fix out to net sooner rather than later. drivers/net/ethernet/intel/ice/ice_lib.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 4b1e56396293..de7ba87af45d 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -2620,10 +2620,6 @@ void ice_vsi_decfg(struct ice_vsi *vsi) if (vsi->type == ICE_VSI_VF && vsi->agg_node && vsi->agg_node->valid) vsi->agg_node->num_vsis--; - if (vsi->agg_node) { - vsi->agg_node->valid = false; - vsi->agg_node->agg_id = 0; - } } /**