bnxt_en: Enable online self tests for multi-host/NPAR mode.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Mon, 12 Oct 2020 09:10:47 +0000 (05:10 -0400)
committerJakub Kicinski <kuba@kernel.org>
Mon, 12 Oct 2020 21:27:02 +0000 (14:27 -0700)
Online self tests are not disruptive and can be run in NPAR mode
and in multi-host NIC as well.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-3-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 52b4ea6..dcbb7b7 100644 (file)
@@ -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);