Skip to content

Commit 8e6cc90

Browse files
Kalesh APdavem330
authored andcommitted
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: 895621f ("bnxt_en: Don't support offline self test when RoCE driver is loaded") Reviewed-by: Somnath Kotur <[email protected]> Signed-off-by: Kalesh AP <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9ab7a70 commit 8e6cc90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4991,14 +4991,14 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
49914991
if (!bp->num_tests || !BNXT_PF(bp))
49924992
return;
49934993

4994+
memset(buf, 0, sizeof(u64) * bp->num_tests);
49944995
if (etest->flags & ETH_TEST_FL_OFFLINE &&
49954996
bnxt_ulp_registered(bp->edev)) {
49964997
etest->flags |= ETH_TEST_FL_FAILED;
49974998
netdev_warn(dev, "Offline tests cannot be run with RoCE driver loaded\n");
49984999
return;
49995000
}
50005001

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

0 commit comments

Comments
 (0)