Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3111942pxm; Mon, 28 Feb 2022 12:15:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXi+LE5UV20Ll6HLkl2P5dVD6PuekOPYEPIHirwpzXAtvAS268Uiwjf7IlqIBmiszVonW9 X-Received: by 2002:a17:90a:dd45:b0:1bc:9466:9b64 with SMTP id u5-20020a17090add4500b001bc94669b64mr18439465pjv.23.1646079322882; Mon, 28 Feb 2022 12:15:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079322; cv=none; d=google.com; s=arc-20160816; b=08/a0BTVGzuZaBCng+Nla3ctZji2iBqVnn7VCCCaxEgwCzjJYeZDpiU74rGtt4brNc A8SOAxLiEqqslKiCSB9IQJ7DreH3r4JVFAgpRfeQAK92lReAsgFkrdJ9OMggmh7HEZ3g M5CdkuPEgSPPRZ8dE9ZOJXYSgO9xGlG6rSAaoY6LiYFZgMv3gU2gpATw57jHDCnIYTqI tIH49/0kNGDU+f4Gl5Ja40Sc5APNSNY0pD/+mSGoZ6G1uSMH1sgJD8jmwhlcnpWJGO0N 4taAwqPbwAol4zIH3Q60JxuJUGIi8H5kQXIk2pL1zybX5g0F3ODgWZ4iHpImpi8SHRMW utCg== 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=Jgy+DniNTq0bVEJsNjdBoP7MAe+Zsb9rOKB6q+lGD5Y=; b=IzUpfxj3pDiErNL1Sai/4IbljVZijjkZuXRcwYToE74K61Trd1P8gigRVbcyWpiRmk BYmfHI+uHksEy3ECq7cdIy8MQOXCVbKJ2jrm8cfApqL56tv6lBnUg5Wo3yFaJZpy51NC UO1kqQJtxofZuIsdPhU5ZcHjmQMPv+eHizdr25/Fyx9SN7x6poxmXpvAPO+xsmb/IDNh 4YL5Vy91MpcypIEonYirLMTmswChV5I9aDh57thBYj63orVUKSN4WZ4GuTmot+PWg2ll x0SgNcRDUtUV1J0sbgluXZlTSiHJodnY1Svm8C7Ejgn4VExsIx3FD6BJ69gQn62qHXAq yZ0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ES5HMqi5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o16-20020a170902d4d000b001501c9e02eesi10888282plg.6.2022.02.28.12.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:15:22 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ES5HMqi5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6DE7E16E7D7; Mon, 28 Feb 2022 11:37:14 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237806AbiB1SCc (ORCPT + 99 others); Mon, 28 Feb 2022 13:02:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238997AbiB1Ryq (ORCPT ); Mon, 28 Feb 2022 12:54:46 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C56465DD; Mon, 28 Feb 2022 09:44:27 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 1AFBDB81187; Mon, 28 Feb 2022 17:44:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F8CAC340E7; Mon, 28 Feb 2022 17:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070264; bh=fWel57NGuWYRtGpTpjkrapYfIXQoCTYPPo3Nr8rT9gc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ES5HMqi5D0epO3NcYhNZSGfFx32j80xH8/dtleLRKDLMTatdF85nHuhLdWnWrDMqK AW3tZgF3jVMvDv2kT4SXrYGIIzp5jeX9DnHMX3pJ4fLUUdyrcOV47QoFiS0rphoEe7 AuG+RmanIuE66bhWFg115q2b2MwX5D9aZIVpVexI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Edwin Peer , Ben Li , Michael Chan , "David S. Miller" Subject: [PATCH 5.16 045/164] bnxt_en: Fix offline ethtool selftest with RDMA enabled Date: Mon, 28 Feb 2022 18:23:27 +0100 Message-Id: <20220228172404.345412145@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@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=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Michael Chan commit 6758f937669dba14c6aac7ca004edda42ec1b18d upstream. For offline (destructive) self tests, we need to stop the RDMA driver first. Otherwise, the RDMA driver will run into unrecoverable errors when destructive firmware tests are being performed. The irq_re_init parameter used in the half close and half open sequence when preparing the NIC for offline tests should be set to true because the RDMA driver will free all IRQs before the offline tests begin. Fixes: 55fd0cf320c3 ("bnxt_en: Add external loopback test to ethtool selftest.") Reviewed-by: Edwin Peer Reviewed-by: Ben Li Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +++++----- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -10310,12 +10310,12 @@ int bnxt_half_open_nic(struct bnxt *bp) goto half_open_err; } - rc = bnxt_alloc_mem(bp, false); + rc = bnxt_alloc_mem(bp, true); if (rc) { netdev_err(bp->dev, "bnxt_alloc_mem err: %x\n", rc); goto half_open_err; } - rc = bnxt_init_nic(bp, false); + rc = bnxt_init_nic(bp, true); if (rc) { netdev_err(bp->dev, "bnxt_init_nic err: %x\n", rc); goto half_open_err; @@ -10324,7 +10324,7 @@ int bnxt_half_open_nic(struct bnxt *bp) half_open_err: bnxt_free_skbs(bp); - bnxt_free_mem(bp, false); + bnxt_free_mem(bp, true); dev_close(bp->dev); return rc; } @@ -10334,9 +10334,9 @@ half_open_err: */ void bnxt_half_close_nic(struct bnxt *bp) { - bnxt_hwrm_resource_free(bp, false, false); + bnxt_hwrm_resource_free(bp, false, true); bnxt_free_skbs(bp); - bnxt_free_mem(bp, false); + bnxt_free_mem(bp, true); } void bnxt_reenable_sriov(struct bnxt *bp) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -25,6 +25,7 @@ #include "bnxt_hsi.h" #include "bnxt.h" #include "bnxt_hwrm.h" +#include "bnxt_ulp.h" #include "bnxt_xdp.h" #include "bnxt_ptp.h" #include "bnxt_ethtool.h" @@ -3526,9 +3527,12 @@ static void bnxt_self_test(struct net_de if (!offline) { bnxt_run_fw_tests(bp, test_mask, &test_results); } else { - rc = bnxt_close_nic(bp, false, false); - if (rc) + bnxt_ulp_stop(bp); + rc = bnxt_close_nic(bp, true, false); + if (rc) { + bnxt_ulp_start(bp, rc); return; + } bnxt_run_fw_tests(bp, test_mask, &test_results); buf[BNXT_MACLPBK_TEST_IDX] = 1; @@ -3538,6 +3542,7 @@ static void bnxt_self_test(struct net_de if (rc) { bnxt_hwrm_mac_loopback(bp, false); etest->flags |= ETH_TEST_FL_FAILED; + bnxt_ulp_start(bp, rc); return; } if (bnxt_run_loopback(bp)) @@ -3563,7 +3568,8 @@ static void bnxt_self_test(struct net_de } bnxt_hwrm_phy_loopback(bp, false, false); bnxt_half_close_nic(bp); - rc = bnxt_open_nic(bp, false, true); + rc = bnxt_open_nic(bp, true, true); + bnxt_ulp_start(bp, rc); } if (rc || bnxt_test_irq(bp)) { buf[BNXT_IRQ_TEST_IDX] = 1;