]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: hns3: fix reset delay time to avoid configuration timeout
authorJie Wang <wangjie125@huawei.com>
Fri, 12 May 2023 10:00:13 +0000 (18:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:05 +0000 (12:44 +0100)
[ Upstream commit 814d0c786068e858d889ada3153bff82f64223ad ]

Currently the hns3 vf function reset delays 5000ms before vf rebuild
process. In product applications, this delay is too long for application
configurations and causes configuration timeout.

According to the tests, 500ms delay is enough for reset process except PF
FLR. So this patch modifies delay to 500ms in these scenarios.

Fixes: 6988eb2a9b77 ("net: hns3: Add support to reset the enet/ring mgmt layer")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index 48956c30d2eeef1e099061b4f8ad164f40a3be84..ec3d98595198eaec753267cb9f82d264660701ea 100644 (file)
@@ -1432,7 +1432,10 @@ static int hclgevf_reset_wait(struct hclgevf_dev *hdev)
         * might happen in case reset assertion was made by PF. Yes, this also
         * means we might end up waiting bit more even for VF reset.
         */
-       msleep(5000);
+       if (hdev->reset_type == HNAE3_VF_FULL_RESET)
+               msleep(5000);
+       else
+               msleep(500);
 
        return 0;
 }