• Huazhong Tan's avatar
    net: hns3: refactor the procedure of VF FLR · f28368bb
    Huazhong Tan authored
    Currently, the actual work of VF FLR is handled in the reset task,
    which is asynchronous. So in some case, if the preparing and
    rebuilding are not done, then the VF FLR will trigger some problems,
    for example, makes hardware go into chaos.
    
    So this patch separates the process of VF 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 it will get into a wrong state.
    
    BTW, while the hardware reports misc interrupt during pcie_flr(),
    the driver can not receive this interrupt anymore, so disable it
    when hclgevf_flr_prepare() return, and re-enable it when enter
    hclgevf_flr_done().
    
    Avoid declaring internal function hclgevf_enable_vector(), this patch
    also moves its definition forward, and removes unused enum
    hnae3_flr_state.
    Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f28368bb
hclgevf_main.c 83.7 KB