]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net: hns3: fix VF bandwidth does not take effect in some case
authorYonglong Liu <liuyonglong@huawei.com>
Fri, 14 Feb 2020 01:53:42 +0000 (09:53 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 26 Feb 2020 02:57:41 +0000 (20:57 -0600)
BugLink: https://launchpad.net/bugs/1863575
When enabling 4 TC after setting the bandwidth of VF, the bandwidth
of VF will resume to default value, because of the qset resources
changed in this case.

This patch fixes it by using a fixed VF's qset resources according to
HNAE3_MAX_TC macro.

Fixes: ee9e44248f52 ("net: hns3: add support for configuring bandwidth of VF on the host")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 19eb1123b4e9337fe20b1763fec528f837ec6568)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c

index fbc39a2480d058d6bd8caa47ac4d5eb3a278ea60..4cee33f3ecac197dd0dd383395e5e2361b7953f9 100644 (file)
@@ -566,7 +566,7 @@ static void hclge_tm_vport_tc_info_update(struct hclge_vport *vport)
         */
        kinfo->num_tc = vport->vport_id ? 1 :
                        min_t(u16, vport->alloc_tqps, hdev->tm_info.num_tc);
-       vport->qs_offset = (vport->vport_id ? hdev->tm_info.num_tc : 0) +
+       vport->qs_offset = (vport->vport_id ? HNAE3_MAX_TC : 0) +
                                (vport->vport_id ? (vport->vport_id - 1) : 0);
 
        max_rss_size = min_t(u16, hdev->rss_size_max,