Skip to content

Commit 36d1e70

Browse files
Michael Chankuba-moo
authored andcommitted
bnxt_en: Skip PHY loopback ethtool selftest if unsupported by FW
Skip PHY loopback selftest if firmware advertises that it is unsupported in the HWRM_PORT_PHY_QCAPS call. Only show PHY loopback test result to be 0 if the test has run and passes. Do the same for external loopback to be consistent. Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20241217182620.2454075-4-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent fac5472 commit 36d1e70

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4914,20 +4914,26 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
49144914
buf[BNXT_MACLPBK_TEST_IDX] = 0;
49154915

49164916
bnxt_hwrm_mac_loopback(bp, false);
4917+
buf[BNXT_PHYLPBK_TEST_IDX] = 1;
4918+
if (bp->phy_flags & BNXT_PHY_FL_NO_PHY_LPBK)
4919+
goto skip_phy_loopback;
4920+
49174921
bnxt_hwrm_phy_loopback(bp, true, false);
49184922
msleep(1000);
4919-
if (bnxt_run_loopback(bp)) {
4920-
buf[BNXT_PHYLPBK_TEST_IDX] = 1;
4923+
if (bnxt_run_loopback(bp))
49214924
etest->flags |= ETH_TEST_FL_FAILED;
4922-
}
4925+
else
4926+
buf[BNXT_PHYLPBK_TEST_IDX] = 0;
4927+
skip_phy_loopback:
4928+
buf[BNXT_EXTLPBK_TEST_IDX] = 1;
49234929
if (do_ext_lpbk) {
49244930
etest->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE;
49254931
bnxt_hwrm_phy_loopback(bp, true, true);
49264932
msleep(1000);
4927-
if (bnxt_run_loopback(bp)) {
4928-
buf[BNXT_EXTLPBK_TEST_IDX] = 1;
4933+
if (bnxt_run_loopback(bp))
49294934
etest->flags |= ETH_TEST_FL_FAILED;
4930-
}
4935+
else
4936+
buf[BNXT_EXTLPBK_TEST_IDX] = 0;
49314937
}
49324938
bnxt_hwrm_phy_loopback(bp, false, false);
49334939
bnxt_half_close_nic(bp);

0 commit comments

Comments
 (0)