]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: hns3: optimize waiting time for TQP reset
authorZhongzhu Liu <liuzhongzhu@huawei.com>
Wed, 28 Aug 2019 14:23:12 +0000 (22:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Aug 2019 23:57:43 +0000 (16:57 -0700)
This patch optimizes the waiting time for TQP reset.

Signed-off-by: Zhongzhu Liu <liuzhongzhu@huawei.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Peng Li <lipeng321@huawei.com>
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

index 8a5b81d42f8c2595ed421788a053e0de85cd26bc..f43c298a9b2dd9e7c657e48e16d27eaaba8b153a 100644 (file)
@@ -8262,11 +8262,12 @@ int hclge_reset_tqp(struct hnae3_handle *handle, u16 queue_id)
        }
 
        while (reset_try_times++ < HCLGE_TQP_RESET_TRY_TIMES) {
-               /* Wait for tqp hw reset */
-               msleep(20);
                reset_status = hclge_get_reset_status(hdev, queue_gid);
                if (reset_status)
                        break;
+
+               /* Wait for tqp hw reset */
+               usleep_range(1000, 1200);
        }
 
        if (reset_try_times >= HCLGE_TQP_RESET_TRY_TIMES) {
@@ -8300,11 +8301,12 @@ void hclge_reset_vf_queue(struct hclge_vport *vport, u16 queue_id)
        }
 
        while (reset_try_times++ < HCLGE_TQP_RESET_TRY_TIMES) {
-               /* Wait for tqp hw reset */
-               msleep(20);
                reset_status = hclge_get_reset_status(hdev, queue_gid);
                if (reset_status)
                        break;
+
+               /* Wait for tqp hw reset */
+               usleep_range(1000, 1200);
        }
 
        if (reset_try_times >= HCLGE_TQP_RESET_TRY_TIMES) {
index 7ff03b9605e4c1155efe91984079543eefad436e..00c07f87e3d370c0cb94ad7b550f14aa50aa556b 100644 (file)
 #define HCLGE_DEFAULT_UMV_SPACE_PER_PF \
        (HCLGE_UMV_TBL_SIZE / HCLGE_MAX_PF_NUM)
 
-#define HCLGE_TQP_RESET_TRY_TIMES      10
+#define HCLGE_TQP_RESET_TRY_TIMES      200
 
 #define HCLGE_PHY_PAGE_MDIX            0
 #define HCLGE_PHY_PAGE_COPPER          0