Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6101677iog; Thu, 23 Jun 2022 11:20:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1toVY14r9FiglEaIGA2xYd+KEl8VAFCJkpagMRksnwj3f8W1Nw22WOqss2UGrcW9zyr3RhD X-Received: by 2002:a17:907:7d90:b0:722:eea9:afb8 with SMTP id oz16-20020a1709077d9000b00722eea9afb8mr9432952ejc.732.1656008455488; Thu, 23 Jun 2022 11:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656008455; cv=none; d=google.com; s=arc-20160816; b=knFzT1kBENMTKSLwbNtsE0dPzxJXnh4MozlVo+fOY4GiG3wk/CYovZgoiOK2FgphpW ENUZyEQRR259iDpI5Ms4qSbNzFJn5i6z/zpPbOQhdu0Uw8pc11UUjtIHNNi+ME4e1JuM k039jP0Ej0/HV1O6tAgB1kuun8Unoo9sZ27ejt2GzARuFKVrhDU3G4i4TiSv+6JcAO3/ ZOPtUsXy2ZBDqO3gaGSHXcX4CSzSNy6G+HizvCoXJcizksvl/zdYzI93VU0pziAPG3hZ GFTu9REl2uDo4ZHRr48CGyqyqV5IKU42Cq/6b7LZFjYlCt4MsDPkLe4ZVuh1T2TrQV3s PCnA== 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=ZRHQyukQSubpoD1XMzRF6DLQRDoEsA/c7OhZkFxCp7Q=; b=TK7kbsSAoV7ikhBUqiMY8IYejvAElL+4rubQ3Ie/Ln4Oax4zCRM+gWEDX+AIegQoFT XdnHUQUD3fjRZquvJFix/pkrvNzvrr2ZYAotai5iINHzuYuSVI1kv/gjV/nSqOEZYwsv 1AfDQJSkHOeFrCS/ThaQ5w2xLJ3RyS3Dixwh+/6J/B/7dFYaR/uls6EByOppq8JwaZN9 w/SubT0EZlLpNACBF4ks2GSjKSp6vZM6NCLeAKaQHLsHToD3KiNKcULi/AIeaYejTqG1 fKxthg1RPQN8PAyMaKwvFAIF/kmu0G4rHaf9D8orbDheRVXFypw6mIZv+HXZh4K+UhMZ YrVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=otb+UQnN; 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 z8-20020a50eb48000000b00435b8440360si255345edp.399.2022.06.23.11.20.29; Thu, 23 Jun 2022 11:20:55 -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=otb+UQnN; 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 S236861AbiFWSS6 (ORCPT + 99 others); Thu, 23 Jun 2022 14:18:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236734AbiFWSQI (ORCPT ); Thu, 23 Jun 2022 14:16:08 -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 946854F45D; Thu, 23 Jun 2022 10:22:30 -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 2FAD461E0D; Thu, 23 Jun 2022 17:22:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A843C3411B; Thu, 23 Jun 2022 17:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004949; bh=3hWX57Fe0sbAEZh/ogd7FU+vpvMYNzKizzhWPfNe/HQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=otb+UQnNFYQzYhWUSl5ZeHxk5PfGtT7tINR+7YTWbGuPfv3iqHiXgI8IPZtlN61LX MRNrStQe8bUJtTqzXXfXF8QeH6pEQm0DhKBE2mB7n1WMnJnk+Pa855z8+DFMlB3OqL xvU3MPcNARY1q/9t2mzCFrAMCLd8CywcBL4n7620= 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 4.19 201/234] i40e: Fix call trace in setup_tx_descriptors Date: Thu, 23 Jun 2022 18:44:28 +0200 Message-Id: <20220623164348.737996394@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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 5242d3dfeb22..6a70e62836f8 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2195,15 +2195,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; } @@ -2250,9 +2251,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