bnxt_en: Fix ethtool selftest output in one of the failure cases
[ Upstream commit 8e6cc9045380f3f0c48ebda2bda5e1abe263388d ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e039b00ddb
commit
808a7304b5
@@ -4848,6 +4848,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;
|
||||
@@ -4855,7 +4856,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