From patchwork Mon Oct 24 08:19:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Maziarz X-Patchwork-Id: 1693757 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; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) 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=pNB5Tf2U; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mwp0M1TSJz23kL for ; Mon, 24 Oct 2022 19:20:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F2DED60634; Mon, 24 Oct 2022 08:19:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F2DED60634 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1666599596; bh=gZ318AfrN/aGxYcdpTDTdPJ4px1J3k467ZnPvRhFeUw=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=pNB5Tf2UbdgKpRm3pJBfvkJnvQcuzMR5K1VXYQUhYlP1RcbQBKFwCIbbeJfCdWN0h DWaWYVHj4S6L6zuJ5/C/pCiHJlFGDapTjVLFrs6pJD/PevOfwoL/NRxWhMBg3+IwJw SPV7JsFP9kBxchogRCG94Bik7MH5dccvGxcyIg14ZsUd6pjtVl4xcR9ghxwq0UW/+M K4uY8NuBMYhGYygfsRK3vKnxHGyZQor4/oYejhMMeE36wnjTsoSgH6CU0m2mWzvAn6 R/3FQu2V1fu1yCSn31PGym2noGazWr/5y0YuwRdK95QdCGxLx2M6JS4GzOOazdQdaS Z6inOOa0xrpiw== 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 iT3RHxtmBrKk; Mon, 24 Oct 2022 08:19:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 7FC1B60AE8; Mon, 24 Oct 2022 08:19:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7FC1B60AE8 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 83F7A1BF40F for ; Mon, 24 Oct 2022 08:19:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5DEB0813C3 for ; Mon, 24 Oct 2022 08:19:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5DEB0813C3 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JuoFiOf_JGQw for ; Mon, 24 Oct 2022 08:19:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 697138138B Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp1.osuosl.org (Postfix) with ESMTPS id 697138138B for ; Mon, 24 Oct 2022 08:19:50 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6500,9779,10509"; a="306097335" X-IronPort-AV: E=Sophos;i="5.95,207,1661842800"; d="scan'208";a="306097335" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 01:19:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10509"; a="736328154" X-IronPort-AV: E=Sophos;i="5.95,207,1661842800"; d="scan'208";a="736328154" Received: from amlin-019-225.igk.intel.com ([10.102.19.225]) by fmsmga002.fm.intel.com with ESMTP; 24 Oct 2022 01:19:48 -0700 From: Kamil Maziarz To: intel-wired-lan@lists.osuosl.org Date: Mon, 24 Oct 2022 10:19:42 +0200 Message-Id: <20221024081942.34809-1-kamil.maziarz@intel.com> X-Mailer: git-send-email 2.25.1 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=1666599590; x=1698135590; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=x1Wo8cBKA3ylyXwXGsbyB6mAK97mvOz83dw6TQrTHog=; b=NaJG14a/y1Ex0OWgMUM2T0dSu6sR1IvO9uzH/Nmx1cTGOHFOgTIvKO9B MEGkCQoNVW5KujpTP0/JuYvWOQbT/KM0sgruZnKQ12QRzotAuuoB/wh50 PKRHPTfS5FEUXe9YO4U6p1RHaodMCrdw0q5BRURjg4ecN5pMrdqysMqs6 AoDVKzxBVc6A5ExVJzjUOLcf13f/nPIWr2GOS79WT5G3iQB8VSCKauKCC gLIxSW1MbAwC0qbtgVxS1Mr7nf6erFcrCNVeDn3UE6I+v7DNLPW0lNtJC eoCwBAs5QaP+EeFyAiPiCZ7KNYikfNUKyjwAt1QInC2F9Wa02z1Px/tg/ g==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=NaJG14a/ Subject: [Intel-wired-lan] [PATCH net v1] i40e: Fix not setting default xps_cpus after reset 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: Michal Jaron , Kamil Maziarz Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Michal Jaron During tx rings configuration default XPS queue config is set and __I40E_TX_XPS_INIT_DONE is locked. __I40E_TX_XPS_INIT_DONE state is cleared and set again with default mapping only during queues build, it means after first setup or reset with queues rebuild. (i.e. ethtool -L combined ) After other resets (i.e. ethtool -t ) XPS_INIT_DONE is not cleared and those default maps cannot be set again. It results in cleared xps_cpus mapping until queues are not rebuild or mapping is not set by user. Add clearing __I40E_TX_XPS_INIT_DONE state during reset to let the driver set xps_cpus to defaults again after it was cleared. Fixes: 6f853d4f8e93 ("i40e: allow XPS with QoS enabled") Signed-off-by: Michal Jaron Signed-off-by: Kamil Maziarz Tested-by: Gurucharan (A Contingent worker at Intel) --- drivers/net/ethernet/intel/i40e/i40e_main.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 4b3b6e5b612d..2828c3629e6b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -10674,6 +10674,21 @@ static int i40e_rebuild_channels(struct i40e_vsi *vsi) return 0; } +/** + * i40e_clean_xps_state - clean xps state for every tx_ring + * @vsi: ptr to the VSI + **/ +static void i40e_clean_xps_state(struct i40e_vsi *vsi) +{ + int i; + + if (vsi->tx_rings) + for (i = 0; i < vsi->num_queue_pairs; i++) + if (vsi->tx_rings[i]) + clear_bit(__I40E_TX_XPS_INIT_DONE, + vsi->tx_rings[i]->state); +} + /** * i40e_prep_for_reset - prep for the core to reset * @pf: board private structure @@ -10698,8 +10713,10 @@ static void i40e_prep_for_reset(struct i40e_pf *pf) i40e_pf_quiesce_all_vsi(pf); for (v = 0; v < pf->num_alloc_vsi; v++) { - if (pf->vsi[v]) + if (pf->vsi[v]) { + i40e_clean_xps_state(pf->vsi[v]); pf->vsi[v]->seid = 0; + } } i40e_shutdown_adminq(&pf->hw);