Skip to content

Commit 808a730

Browse files
Kalesh APgregkh
authored andcommitted
bnxt_en: Fix ethtool selftest output in one of the failure cases
[ Upstream commit 8e6cc90 ] 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 <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>
1 parent e039b00 commit 808a730

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
@@ -4848,14 +4848,14 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
48484848
if (!bp->num_tests || !BNXT_PF(bp))
48494849
return;
48504850

4851+
memset(buf, 0, sizeof(u64) * bp->num_tests);
48514852
if (etest->flags & ETH_TEST_FL_OFFLINE &&
48524853
bnxt_ulp_registered(bp->edev)) {
48534854
etest->flags |= ETH_TEST_FL_FAILED;
48544855
netdev_warn(dev, "Offline tests cannot be run with RoCE driver loaded\n");
48554856
return;
48564857
}
48574858

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

0 commit comments

Comments
 (0)