From patchwork Tue Apr 30 22:44:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13650007 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DE332C853 for ; Tue, 30 Apr 2024 22:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714517178; cv=none; b=FHnLDHX/hcsVsD3VO6y+gerkXRGAU9afCBLw9eOoj11fYeoJCYNZRtSzuT5Piqq8gPfY6xAiLWXz16OHOh74l0lJBNWVWcrn6d8+uPcRV0PPO64/8cK5SeAsyj+K4jK+9bn+Fsp8IJBApXSZM2FZvZfFtAHzL9cWyKBMqvqA+UA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714517178; c=relaxed/simple; bh=tkGXFQXtAWmsicJg0LJ2zyBkyzztbvR2v4gqgvSJNgY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=EssGHwgVSUy49QLfoj6yB1xoTpGz4RElXcAsWbIoXPkEcAPvUUP5zzJ2dQ3FSApmUWxdlJH/aGdGQ2kYCDtxBxIWcBCgoy4Bp3ClhZTxW8jNFPPeTJJgFhHLK7vEd4yNvPDLCy9T/CeWyhquRi0uLhlgCs+dbuQeTPTefUZDZzQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=dPv37e/b; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="dPv37e/b" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1ec41d82b8bso12335675ad.2 for ; Tue, 30 Apr 2024 15:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1714517176; x=1715121976; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=0FwS7qe6zFjFa4NLwF+MQne8+Z4JoQ0VM2BJTZ+bUHM=; b=dPv37e/bmA1/Wu3SPNdnKxrwqX47OkKPaKddwO8sNuFmVmKW53TAS5e9d2ux+iG+eC ttad2SuNWGGkJDCZHcewZNcX+BKcgsSPnAtZwz+Ukl6H0y37Pj0QeG4bOq6vxxtz3xoP 1WQsYizYbMSsOD68gTmKYXG/u40p019SX8zNs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714517176; x=1715121976; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0FwS7qe6zFjFa4NLwF+MQne8+Z4JoQ0VM2BJTZ+bUHM=; b=HxOVJPk35cKXKY+fFXTnu3sxM7gILUy6kRvZSCLrysJ7sin1NhD8yQ++ThI7Z0fqeO GfvWUdXhC0ZCdDfm6WfIe6kD4uDQkx4I+0P4/DDzOYZzygLXKUd/Yj2MYUSP06UaLKmr hUwzpZzvyaxrtJXTjrmtX175DpfKNeQpnWRj0UskFUjcA6VkKVc/1NKvvzdJ0ZyrLdgc o9AbfySygQNU+ZiKT8MilYOmmAIuYdMgdtqwC23Ga3wlqtXovl3wz8evkGNawVJ+Xrln oQJ2g1cf1Bz8UvDMepy0kbA9YKWb3P4ft/VRcFe4c8VqHeRd5/iG1cgg0VK5Au68l5JJ A9Dw== X-Gm-Message-State: AOJu0YxVumJK4HhFXWCxFu399DtmhnnJz7qKpjXDreqswps75efo7Hb4 cZYcNhZPm49hokFI4IL2yt1nbLF8+cvE78EXl8nmgQ1RCPS0FLKpksyVDO71ZA== X-Google-Smtp-Source: AGHT+IE62mEZCwNX4fpGfvu61VW5wrI/m3QlSrHvbTFZtxogrx/kR4hkkwwvzXnj9g9cnzYf4gLvAw== X-Received: by 2002:a17:902:f682:b0:1e7:d482:9e07 with SMTP id l2-20020a170902f68200b001e7d4829e07mr859876plg.12.1714517175343; Tue, 30 Apr 2024 15:46:15 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id s11-20020a170902a50b00b001eb2fb28eabsm7836476plq.227.2024.04.30.15.46.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2024 15:46:14 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew.gospodarek@broadcom.com, Kalesh AP , Selvin Thyparampil Xavier , Vikas Gupta , Pavan Chebbi Subject: [PATCH net-next 3/7] bnxt_en: Don't support offline self test when RoCE driver is loaded Date: Tue, 30 Apr 2024 15:44:34 -0700 Message-Id: <20240430224438.91494-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240430224438.91494-1-michael.chan@broadcom.com> References: <20240430224438.91494-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Kalesh AP Offline self test is a very disruptive operation for RoCE and requires all active QPs to be destroyed. With a large number of QPs, it can take a long time to destroy all the QPs and can timeout. Do not allow ethtool offline self test if the RoCE driver is registered on the device. Reviewed-by: Selvin Thyparampil Xavier Reviewed-by: Vikas Gupta Reviewed-by: Pavan Chebbi Signed-off-by: Kalesh AP Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 6de3cfcea90f..8763f8a01457 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -4820,6 +4820,14 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest, if (!bp->num_tests || !BNXT_PF(bp)) return; + + if (etest->flags & ETH_TEST_FL_OFFLINE && + bnxt_ulp_registered(bp->edev)) { + etest->flags |= ETH_TEST_FL_FAILED; + netdev_warn(dev, "Offline tests cannot be run with RoCE driver loaded\n"); + return; + } + memset(buf, 0, sizeof(u64) * bp->num_tests); if (!netif_running(dev)) { etest->flags |= ETH_TEST_FL_FAILED; @@ -4850,7 +4858,6 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest, if (!offline) { bnxt_run_fw_tests(bp, test_mask, &test_results); } else { - bnxt_ulp_stop(bp); bnxt_close_nic(bp, true, false); bnxt_run_fw_tests(bp, test_mask, &test_results); @@ -4861,7 +4868,6 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest, 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)) @@ -4888,7 +4894,6 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest, bnxt_hwrm_phy_loopback(bp, false, false); bnxt_half_close_nic(bp); rc = bnxt_open_nic(bp, true, true); - bnxt_ulp_start(bp, rc); } if (rc || bnxt_test_irq(bp)) { buf[BNXT_IRQ_TEST_IDX] = 1;