]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: hns3: Disable vf vlan filter when vf vlan table is full
authorYunsheng Lin <linyunsheng@huawei.com>
Fri, 1 Jun 2018 16:52:01 +0000 (17:52 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 18:41:24 +0000 (14:41 -0400)
BugLink: https://bugs.launchpad.net/bugs/1768670
This is only 128 entries for hardware's vf vlan table, when
the vf table is full, the firmware will disable the vf vlan
filter and return a resp_code of HCLGE_VF_VLAN_NO_ENTRY to
driver.

This patch checks the if resp_code from firmware is
HCLGE_VF_VLAN_NO_ENTRY, if yes, then print a warning and
return ok to the caller.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6c251711b37ff14e2507bbc2401ac3ef0935ceb1 linux-next)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 69166858a6dc07c069c2d3bd2ec5c664f5bade38..4ca53189d48d8a65d6592034fb8117115713a9ed 100644 (file)
@@ -4525,9 +4525,16 @@ static int hclge_set_vf_vlan_common(struct hclge_dev *hdev, int vfid,
        }
 
        if (!is_kill) {
+#define HCLGE_VF_VLAN_NO_ENTRY 2
                if (!req0->resp_code || req0->resp_code == 1)
                        return 0;
 
+               if (req0->resp_code == HCLGE_VF_VLAN_NO_ENTRY) {
+                       dev_warn(&hdev->pdev->dev,
+                                "vf vlan table is full, vf vlan filter is disabled\n");
+                       return 0;
+               }
+
                dev_err(&hdev->pdev->dev,
                        "Add vf vlan filter fail, ret =%d.\n",
                        req0->resp_code);