net: hns3: set the port shaper according to MAC speed
authorYunsheng Lin <linyunsheng@huawei.com>
Mon, 3 Jun 2019 02:09:16 +0000 (10:09 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jun 2019 22:32:50 +0000 (15:32 -0700)
This patch sets the port shaper according to the MAC speed as
suggested by hardware user manual.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-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_tm.c

index a7bbb6d..fac5193 100644 (file)
@@ -397,7 +397,7 @@ static int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev)
        u8 ir_u, ir_b, ir_s;
        int ret;
 
-       ret = hclge_shaper_para_calc(HCLGE_ETHER_MAX_RATE,
+       ret = hclge_shaper_para_calc(hdev->hw.mac.speed,
                                     HCLGE_SHAPER_LVL_PORT,
                                     &ir_b, &ir_u, &ir_s);
        if (ret)