]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: add handshake with VF for PF reset
authorHuazhong Tan <tanhuazhong@huawei.com>
Fri, 9 Aug 2019 02:31:17 +0000 (10:31 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Aug 2019 20:44:33 +0000 (13:44 -0700)
commit16b693c32c939a51f3e15a0f5373d4fb5d6e3fd8
tree364aa6bb40ac4f1f5414ba1e6049e9c572fdaed2
parent3f8821348f3b874f56b928073d1f245b3d1d1dc9
net: hns3: add handshake with VF for PF reset

Before PF asserting function reset, it should make sure
that all its VFs have been ready, otherwise, it will cause
some hardware errors.

So this patch adds function hclge_func_reset_sync_vf() to
synchronize VF before asserting PF function reset. For new
firmware which supports command HCLGE_OPC_QUERY_VF_RST_RDY,
we will try to query VFs' ready status within 30 seconds.
And keep the old implementation for compatible with firmware
which does not support this command.

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