Commit 8e6cc904 authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller
Browse files

bnxt_en: Fix ethtool selftest output in one of the failure cases



When RDMA driver is loaded, running offline self test is not
supported and driver returns failure early. But it is not clearing
the input buffer and hence the application prints some junk
characters for individual test results.

Fix it by clearing the buffer before returning.

Fixes: 895621f1 ("bnxt_en: Don't support offline self test when RoCE driver is loaded")
Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ab7a709
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4991,6 +4991,7 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
	if (!bp->num_tests || !BNXT_PF(bp))
		return;

	memset(buf, 0, sizeof(u64) * bp->num_tests);
	if (etest->flags & ETH_TEST_FL_OFFLINE &&
	    bnxt_ulp_registered(bp->edev)) {
		etest->flags |= ETH_TEST_FL_FAILED;
@@ -4998,7 +4999,6 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
		return;
	}

	memset(buf, 0, sizeof(u64) * bp->num_tests);
	if (!netif_running(dev)) {
		etest->flags |= ETH_TEST_FL_FAILED;
		return;