From patchwork Mon Oct 12 09:10:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 270095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCE3AC433DF for ; Mon, 12 Oct 2020 09:11:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86DB42145D for ; Mon, 12 Oct 2020 09:11:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="PQNpIrIA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729264AbgJLJLS (ORCPT ); Mon, 12 Oct 2020 05:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729075AbgJLJLR (ORCPT ); Mon, 12 Oct 2020 05:11:17 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53631C0613D0 for ; Mon, 12 Oct 2020 02:11:17 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id e10so12941904pfj.1 for ; Mon, 12 Oct 2020 02:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oHtz6W3fJN30D9Y2QS+JEp+DqO/4kmAxy22G4WX1KA0=; b=PQNpIrIA2IAYi3vfRS2rZ9Tt9GTcIMTyu2IwiykGyMn/F47qayK1tl5etVzk+HBa7n 62XpXJBxFrz+ldmncFCj0tWuTMcf/6tyKPjoEgJTIyf9aXF00ToAygS2Myfwy7Ht70Y8 WC9xO7DeLumG+ffctZvX7hEj2Nrsk1vlxBJ3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oHtz6W3fJN30D9Y2QS+JEp+DqO/4kmAxy22G4WX1KA0=; b=YAU4T2HI08TPQI/WvORiIDi5V1sIfBcuaepG/sqIzzBQlACMCY5skcWLPOrmXqx3qW mOSomZkdGW7yhRJ1LfKBebLwoYLqz1+Gs403iajk8u14uI3R3TyzP4I50VWWDN3iZqWj bYvkiopBRK+6mP+iyCZ8XC/M18jr8kp2gUmmitCOvtdrAzP3dofPXVhvcfEK0l91k0cr DR8srI2tiaXVDUGijrEFJKGHswb9mSu8O043Zp4EHEuO0ebnifY9gLNrW9KBUOgQUCBO s0j+k3i8bFgSrMrH8odMaD6ZLmM0Rn+z2Hmlg1HloXHYnVu3hn6LVs05F+MFW4xq0yI2 qkkQ== X-Gm-Message-State: AOAM5321u/1JS73FMhIBM367lgw9KwfEVTFVYuwi9GfbjOEC+1BeVbzO QbvC/+MNDDSIM3PNrI6ykb29Aw== X-Google-Smtp-Source: ABdhPJwbyw81fajEzX9rTC1a1orU9ssqNX3VIkn4qxFUm60HWFy0PFt9X4zBBc6tTBwxL76k8fFSgg== X-Received: by 2002:a17:90b:490:: with SMTP id bh16mr18373700pjb.214.1602493876773; Mon, 12 Oct 2020 02:11:16 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id jy19sm1275932pjb.9.2020.10.12.02.11.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2020 02:11:15 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com, Vasundhara Volam Subject: [PATCH net-next v2 2/9] bnxt_en: Enable online self tests for multi-host/NPAR mode. Date: Mon, 12 Oct 2020 05:10:47 -0400 Message-Id: <1602493854-29283-3-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602493854-29283-1-git-send-email-michael.chan@broadcom.com> References: <1602493854-29283-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vasundhara Volam Online self tests are not disruptive and can be run in NPAR mode and in multi-host NIC as well. Reviewed-by: Edwin Peer Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 52b4ea6ef8c9..dcbb7b70d60a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -3298,7 +3298,7 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest, u8 test_mask = 0; int rc = 0, i; - if (!bp->num_tests || !BNXT_SINGLE_PF(bp)) + if (!bp->num_tests || !BNXT_PF(bp)) return; memset(buf, 0, sizeof(u64) * bp->num_tests); if (!netif_running(dev)) { @@ -3311,9 +3311,9 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest, do_ext_lpbk = true; if (etest->flags & ETH_TEST_FL_OFFLINE) { - if (bp->pf.active_vfs) { + if (bp->pf.active_vfs || !BNXT_SINGLE_PF(bp)) { etest->flags |= ETH_TEST_FL_FAILED; - netdev_warn(dev, "Offline tests cannot be run with active VFs\n"); + netdev_warn(dev, "Offline tests cannot be run with active VFs or on shared PF\n"); return; } offline = true; @@ -3829,7 +3829,7 @@ void bnxt_ethtool_init(struct bnxt *bp) bnxt_get_pkgver(dev); bp->num_tests = 0; - if (bp->hwrm_spec_code < 0x10704 || !BNXT_SINGLE_PF(bp)) + if (bp->hwrm_spec_code < 0x10704 || !BNXT_PF(bp)) return; bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_SELFTEST_QLIST, -1, -1);