]> asedeno.scripts.mit.edu Git - linux.git/commit
net: hns3: refactor the precedure of PF FLR
authorHuazhong Tan <tanhuazhong@huawei.com>
Sat, 11 Jan 2020 08:33:49 +0000 (16:33 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Jan 2020 22:52:22 +0000 (14:52 -0800)
commit8627bdedc435865b015cedeb26e3791dec5b3a41
tree7f0b5a09f5acf0a7c272201a652b07325ecbd097
parent1cc9bc6e586782921f2bc31fd9f121e8fe2de100
net: hns3: refactor the precedure of PF FLR

Currently, the actual work of PF FLR is handled in the reset task,
which is asynchronous. So in some case, if the preparing and
rebuilding are not done, then the PF FLR will trigger some problems,
for example, makes hardware go into chaos.

So this patch separates the process of PF FLR from reset task, and
adds a semaphore to serialize this reset and others.

When FLR's preparing fails, if there has other higher level reset
pending or failing times less than the HCLGE_FLR_RETRY_CNT, this
preparing should be retried, otherwise PF and its VF may get into
wrong state.

BTW, while the hardware reports misc interrupt during pcie_flr(),
the driver can not receive this interrupt anymore, so disable it
when hclge_flr_prepare() return, and re-enable it when enter
hclge_flr_done().

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h