mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 18:12:25 -04:00
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: 895621f1c8 ("bnxt_en: Don't support offline self test when RoCE driver is loaded")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
9ab7a709c9
commit
8e6cc90453
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user