Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2933402iog; Mon, 20 Jun 2022 07:46:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vcIImD8wyRqIyUaUMNYPu/A9iKorS2pvpPK04IsoX2KBaPSnuBgQvYgYZTAzEhhSNOdGE6 X-Received: by 2002:a05:6402:1bc1:b0:435:67ef:2f41 with SMTP id ch1-20020a0564021bc100b0043567ef2f41mr18729777edb.85.1655736409717; Mon, 20 Jun 2022 07:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736409; cv=none; d=google.com; s=arc-20160816; b=xwVWwKgssQE7DZw5ckcHLLINMW+r79MxKlP77Iik4vwjfIKcEu5jjHAAJPX44pb+do fsS33ngIcr6z6Rf0KPBe9keBFtsmeJ6c0SNqs3GFVmWdURLDJgzaN6p12Nh0J1d71m5F egbsfOqnI1EDrdtMLR5gOW7rzHnR7xersdU+y0sq3pBh91VQhhbFN593p8pBQOiB+1ls BMeOWFW8DXSrr5l80MeDJo/juPsWfqWgsIAJ3Em19B8nnZD1k6q2k3l3al0WWEfjIUVW ADCCgB28MlCriaR8zRN3xCQ0CXL+EKInR6X0Tc/bh/ekcoWR4C/e9cFVcLQ8b6D41ZqA BGfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9eREslBlDnGPDemvxLpNzi4tlNVgGNYHS4vPqE0OCEU=; b=Lt1vzlziX8st5HhDmMAKnh/pGobWtytxXkI6oKf0hpyxAKwWaxzc1B5zj8eHxTTuT6 k4b+/kKd3pQOWdRITZHuXZAqmLhFEAQm6gow23f3chuRXVPngmkIKUN6PXJMz11H/4ll dsoGzSmEYxS3d26gYDlTwPzpglc6JIRv0Uz4dSUzyTW+T4kdpH8wYxWHKZanSguraF0l M3Pkk/Z8xj/3NgExydTc4k8zxCW23ZoN8gqWECSL8pD4HfZDYUTExm8NUGTc9j8sngqp 0Mwlzq8sdT03dj5ozF1VRR5FpT1xX8yxoQLoJjre/y7DTJZk5WoZnDsfNBqD9cOTRxIY 9vaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AJWUPVXy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a17090699c300b00711f5622a37si13460039ejn.242.2022.06.20.07.46.23; Mon, 20 Jun 2022 07:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AJWUPVXy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343712AbiFTNWt (ORCPT + 99 others); Mon, 20 Jun 2022 09:22:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346214AbiFTNUX (ORCPT ); Mon, 20 Jun 2022 09:20:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 088632A1; Mon, 20 Jun 2022 06:08:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1316F615C3; Mon, 20 Jun 2022 13:07:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06000C341C8; Mon, 20 Jun 2022 13:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655730440; bh=v+1O8n4EHE6XlM6AtNFoQ+Jtk79q239zVi5gqrD+RAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AJWUPVXy3dNdYwyRhxslPq9VNE6Yl+2UlIc1KYrsOiCPDPN3CPvNEA0VC3kigyHcO aqRw07BKUkuz7356ecoGzWYHxZaITEpn5Z+19qGcLpfN3DcjhSvMY81nz3dWo8rZhS tVqPvG9O59VzMDRfoninwBIzN5ivpC4qyfuGtvi0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Jaron , Aleksandr Loktionov , Tony Nguyen , Sasha Levin , Gurucharan Subject: [PATCH 5.15 053/106] i40e: Fix call trace in setup_tx_descriptors Date: Mon, 20 Jun 2022 14:51:12 +0200 Message-Id: <20220620124725.964612780@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124724.380838401@linuxfoundation.org> References: <20220620124724.380838401@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aleksandr Loktionov [ Upstream commit fd5855e6b1358e816710afee68a1d2bc685176ca ] After PF reset and ethtool -t there was call trace in dmesg sometimes leading to panic. When there was some time, around 5 seconds, between reset and test there were no errors. Problem was that pf reset calls i40e_vsi_close in prep_for_reset and ethtool -t calls i40e_vsi_close in diag_test. If there was not enough time between those commands the second i40e_vsi_close starts before previous i40e_vsi_close was done which leads to crash. Add check to diag_test if pf is in reset and don't start offline tests if it is true. Add netif_info("testing failed") into unhappy path of i40e_diag_test() Fixes: e17bc411aea8 ("i40e: Disable offline diagnostics if VFs are enabled") Fixes: 510efb2682b3 ("i40e: Fix ethtool offline diagnostic with netqueues") Signed-off-by: Michal Jaron Signed-off-by: Aleksandr Loktionov Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- .../net/ethernet/intel/i40e/i40e_ethtool.c | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 513ba6974355..0e13ce9b4d00 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2576,15 +2576,16 @@ static void i40e_diag_test(struct net_device *netdev, set_bit(__I40E_TESTING, pf->state); + if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) || + test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) { + dev_warn(&pf->pdev->dev, + "Cannot start offline testing when PF is in reset state.\n"); + goto skip_ol_tests; + } + if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) { dev_warn(&pf->pdev->dev, "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n"); - data[I40E_ETH_TEST_REG] = 1; - data[I40E_ETH_TEST_EEPROM] = 1; - data[I40E_ETH_TEST_INTR] = 1; - data[I40E_ETH_TEST_LINK] = 1; - eth_test->flags |= ETH_TEST_FL_FAILED; - clear_bit(__I40E_TESTING, pf->state); goto skip_ol_tests; } @@ -2631,9 +2632,17 @@ static void i40e_diag_test(struct net_device *netdev, data[I40E_ETH_TEST_INTR] = 0; } -skip_ol_tests: - netif_info(pf, drv, netdev, "testing finished\n"); + return; + +skip_ol_tests: + data[I40E_ETH_TEST_REG] = 1; + data[I40E_ETH_TEST_EEPROM] = 1; + data[I40E_ETH_TEST_INTR] = 1; + data[I40E_ETH_TEST_LINK] = 1; + eth_test->flags |= ETH_TEST_FL_FAILED; + clear_bit(__I40E_TESTING, pf->state); + netif_info(pf, drv, netdev, "testing failed\n"); } static void i40e_get_wol(struct net_device *netdev, -- 2.35.1