From patchwork Wed May 1 00:30:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13650145 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.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 295E5440C for ; Wed, 1 May 2024 00:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714523503; cv=none; b=haR2zTii+QlcaeXObKTsOdgxBxdFAjPtNeXvqTfriCxC6erYoZcCWlTdGfTGwNHnCub+aKBMEgvACBFEFRDym8+4HSI+2NFgmuetWA0yfoSj8b9I46IKBbU2e8VGjLzI1wIUjxQJoC/1kanzSxduXML7gC9E+OD+K6lch0OOSkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714523503; c=relaxed/simple; bh=LFuzWH1gh0KgOo5qZjHke1P4udiwFwmeZ3oIUo4aDSI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=kOdi3dgqGoJkJ0Wjj/CeXgIOfBFqmcQBdwbHbM33cQ6pR8lh2kFWNCEW5t94WJEKoZd6LMoUAJwiekTMJu9iQMvWVq70IgQ2VoqzCIHSRm0OW6WxFqiiZXU91XLSDOT6Po5R6wZJ7H07ZW+5rB/02j0FVr7so1i2asGKQ2G/iQY= 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=C0bKRI5k; arc=none smtp.client-ip=209.85.160.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="C0bKRI5k" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-43a14bce92dso40615831cf.0 for ; Tue, 30 Apr 2024 17:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1714523501; x=1715128301; 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=uaW4JHu8nYyJ/+mO9NHtArvvlgEPBuPNOIHZQ+qGKcU=; b=C0bKRI5kHmcYACTFVZ+ueH8HRTZBOIyRE4MusbvxxTqf/XJo2QPSkd7cLoDRzxFHDP F30oWJLijcF8b1UsknbQr3YrpiWEKyP+QYU4cwB5ZJQ72ZN/n8s0VGKN6jj7ZXL9nMKS sV7wMvA2bY7F2uu6cEXvR8UkCbYOnputnbSTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714523501; x=1715128301; 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=uaW4JHu8nYyJ/+mO9NHtArvvlgEPBuPNOIHZQ+qGKcU=; b=W5e7lzIGDIZdF9bV/LUsZLcml+6ug/dvxhoFOJnO/vXB42/vCFI+OO/hxercVDYatg 3K67Vv447/+t43O9TEPQImdkNobbnQWEGjbZ3JGUf3HyWib2BHITEZYpEeicSCzIjF8k aqbJwaza5ya9Kml4Dk/wCXgPfjAl27PVRy+Qc85xF9n7NaEblTtBk7oObt/TTuGXZFoA pUOg/LIt9WVy0fi4/XuReKJe1NVOl7b3lbO9RHMYLS6B1S/rkjA5yD+FzahoBQnjLgWP dfep/oMkbKLtQIYNknqofMYKxa4eMaxP9tAlE4EL5WhEBfB+oHO6bQCCPrsrXaz4aeeW re5g== X-Gm-Message-State: AOJu0YwN8fP5XTr/44MazSjPBfRAxmPMug1G5vgFhTq+Hxud/8ObeqPb fgvMp2pF/RLgXqzCaV+wJlk0csFpJF8ipcIEOLVfUqA1Klr/aG0iLyLwsiT2Hg== X-Google-Smtp-Source: AGHT+IF33Qs9LrC9lhJzKD2qkHEjXmVO2YYxnZta8DfbP/biucvRkegMTH6vJYaT5SW0xxai2fAfXg== X-Received: by 2002:ac8:7f87:0:b0:43a:ef50:e6f1 with SMTP id z7-20020ac87f87000000b0043aef50e6f1mr898140qtj.33.1714523500597; Tue, 30 Apr 2024 17:31:40 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id f15-20020ac8470f000000b0043a7cb47069sm4337935qtp.9.2024.04.30.17.31.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2024 17:31:39 -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 v2 2/6] bnxt_en: Don't support offline self test when RoCE driver is loaded Date: Tue, 30 Apr 2024 17:30:52 -0700 Message-Id: <20240501003056.100607-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240501003056.100607-1-michael.chan@broadcom.com> References: <20240501003056.100607-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 Reviewed-by: Simon Horman --- 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;