net: hns: Avoid net reset caused by pause frames storm
authorYonglong Liu <liuyonglong@huawei.com>
Sat, 15 Dec 2018 03:53:26 +0000 (11:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 08:51:01 +0000 (09:51 +0100)
commitdb2ca348c80c462e0f896287366df8b090b486a6
tree549c0aff43d08a6f9cec28b8d5094b3d8fd52076
parentc8e78cbcde24a7bab0a5b1a897efa439b025f981
net: hns: Avoid net reset caused by pause frames storm

[ Upstream commit a57275d35576fdd89d8c771eedf1e7cf97e0dfa6 ]

There will be a large number of MAC pause frames on the net,
which caused tx timeout of net device. And then the net device
was reset to try to recover it. So that is not useful, and will
cause some other problems.

So need doubled ndev->watchdog_timeo if device watchdog occurred
until watchdog_timeo up to 40s and then try resetting to recover
it.

When collecting dfx information such as hardware registers when tx timeout.
Some registers for count were cleared when read. So need move this task
before update net state which also read the count registers.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns/hns_enet.c