Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3112312pxm; Mon, 28 Feb 2022 12:15:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwytKe+r/dgk/PnSPgdEAg/KGU3lXCVPQueVsIbs8ArFsSxeVFdvHOk3X6aNrGfTOyr0Gk/ X-Received: by 2002:a63:b257:0:b0:376:7f43:5449 with SMTP id t23-20020a63b257000000b003767f435449mr15624574pgo.201.1646079352922; Mon, 28 Feb 2022 12:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079352; cv=none; d=google.com; s=arc-20160816; b=yihpjPewo4cdAKJECPAqoXWGICxmHU0hrSJCb+yCMFrU76B1r7ybMfmuLuTQ08Cj1z uuT6ysO1gEPTodu0Pvyr/hm7BW1/uj5NHQkh9VVcngv3lhxRgX74eDZVF+zXNACNhgLJ jVDRLX1V169V1ousHXeGX6N+9pib8PUb99DGQqFEKT7uP3Zdm4ENKG1UawzaHVkqPmbV j+2vlj0b+dUHaPSawMookm2WdlwZOdWRhfZeCiiA2L/DMWIBnt9fxfM8ufvpHBrM3Fim V9TN2MxSsSPYrD3pT87dxiwcsMb/FMJT0k8Hsu3EwJrRjCh+axSbZMLApFOW5BkfClgU wLBw== 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=8CrCPUQ+yY/tTwJI3cRSLKe3Ls0ieMkTKqrJeCxtI5U=; b=SmdnBMNEJ8aAm33a21XLoKv6LLPdKy5vZQQ10Lk5xeDC2a9XbcPCQdXFXIPMMAk7i4 FoRI58hv6hK8Vco+YhKBiUexLpHDPEVpXwvPd7qsfeZqa6hEQ0V/sREjfNTeYu6A9vhg DAuruP2eP7eweqVb2oQSkquqbivKpCz+cPEBjMpli67zfXuMT6MtRtFzEbApnbaM5jBN 4UWrg+Um5WPEKg1pxlFyC8Aw8SeYvXFVvwpaWDb5cqV7KBJsmHn3vQR6vV+ln79nSAeH a5bxRVNyLqLdjUVBUW6lBLUCKdY66GozX2Aw+FxLXswQYguj/IZiDhKq8xIDSJEwwtiI 86FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K19yfwFz; 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 b15-20020a630c0f000000b003784b82b88esi9240481pgl.269.2022.02.28.12.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:15:52 -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=K19yfwFz; 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 1F9AA1795FC; Mon, 28 Feb 2022 11:37:48 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240870AbiB1SES (ORCPT + 99 others); Mon, 28 Feb 2022 13:04:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239363AbiB1Rwz (ORCPT ); Mon, 28 Feb 2022 12:52:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CA16A94D7; Mon, 28 Feb 2022 09:40:09 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 455056156B; Mon, 28 Feb 2022 17:40:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55268C340E7; Mon, 28 Feb 2022 17:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070005; bh=nxXKOafHAT91L+KEcpG5Ig/Ag6ujqpSqA5C2JyOG9ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K19yfwFzkvTU55nNV32pmjG40BrNUpYv20IKLvt9diOL2WmM8f62vHWcVDhFiX0lW R91/aBtG+KqVf+IF3Kn0UJgpdb15ENSHkw7hBmcvs1G0H4wnhyf+pOjpMlCg0/YT2k 2zaJ9pgOoJf+sZ88Zfq6gW10CfQE4k7YfLK7ajtE= 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.15 043/139] bnxt_en: Fix offline ethtool selftest with RDMA enabled Date: Mon, 28 Feb 2022 18:23:37 +0100 Message-Id: <20220228172352.247071663@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172347.614588246@linuxfoundation.org> References: <20220228172347.614588246@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 @@ -10295,12 +10295,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; @@ -10309,7 +10309,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; } @@ -10319,9 +10319,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); } static 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" @@ -3502,9 +3503,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; @@ -3514,6 +3518,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)) @@ -3539,7 +3544,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;