Skip to content

Commit 895621f

Browse files
Kalesh APkuba-moo
authored andcommitted
bnxt_en: Don't support offline self test when RoCE driver is loaded
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 <[email protected]> Reviewed-by: Vikas Gupta <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: Kalesh AP <[email protected]> Signed-off-by: Michael Chan <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a75fbb3 commit 895621f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4820,6 +4820,14 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
48204820

48214821
if (!bp->num_tests || !BNXT_PF(bp))
48224822
return;
4823+
4824+
if (etest->flags & ETH_TEST_FL_OFFLINE &&
4825+
bnxt_ulp_registered(bp->edev)) {
4826+
etest->flags |= ETH_TEST_FL_FAILED;
4827+
netdev_warn(dev, "Offline tests cannot be run with RoCE driver loaded\n");
4828+
return;
4829+
}
4830+
48234831
memset(buf, 0, sizeof(u64) * bp->num_tests);
48244832
if (!netif_running(dev)) {
48254833
etest->flags |= ETH_TEST_FL_FAILED;
@@ -4850,7 +4858,6 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
48504858
if (!offline) {
48514859
bnxt_run_fw_tests(bp, test_mask, &test_results);
48524860
} else {
4853-
bnxt_ulp_stop(bp);
48544861
bnxt_close_nic(bp, true, false);
48554862
bnxt_run_fw_tests(bp, test_mask, &test_results);
48564863

@@ -4861,7 +4868,6 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
48614868
if (rc) {
48624869
bnxt_hwrm_mac_loopback(bp, false);
48634870
etest->flags |= ETH_TEST_FL_FAILED;
4864-
bnxt_ulp_start(bp, rc);
48654871
return;
48664872
}
48674873
if (bnxt_run_loopback(bp))
@@ -4888,7 +4894,6 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
48884894
bnxt_hwrm_phy_loopback(bp, false, false);
48894895
bnxt_half_close_nic(bp);
48904896
rc = bnxt_open_nic(bp, true, true);
4891-
bnxt_ulp_start(bp, rc);
48924897
}
48934898
if (rc || bnxt_test_irq(bp)) {
48944899
buf[BNXT_IRQ_TEST_IDX] = 1;

0 commit comments

Comments
 (0)