]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: hns3: Fix for vf vlan delete failed problem
authorYunsheng Lin <linyunsheng@huawei.com>
Mon, 3 Sep 2018 10:21:46 +0000 (11:21 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: https://bugs.launchpad.net/bugs/1810457
There are only 128 entries in vf vlan table, if user has added
more than 128 vlan, fw will ignore it and disable the vf vlan
table. So when user deletes the vlan entry that has not been
set to vf vlan table, fw will return not found result and driver
treat that as error, which will cause vlan delete failed problem.

This patch fixes it by returning ok when fw returns not found
result.

Fixes: 6c251711b37f ("net: hns3: Disable vf vlan filter when vf vlan table is full")
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 41dafea2af781d8e3ab8626d236b52e4172905a3)
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: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 531474f729dec07a61d71d525f74e7ae890c4f6e..86b510c773d59feddac5d08c2b581eb893d1bac0 100644 (file)
@@ -4686,9 +4686,17 @@ static int hclge_set_vf_vlan_common(struct hclge_dev *hdev, int vfid,
                        "Add vf vlan filter fail, ret =%d.\n",
                        req0->resp_code);
        } else {
+#define HCLGE_VF_VLAN_DEL_NO_FOUND     1
                if (!req0->resp_code)
                        return 0;
 
+               if (req0->resp_code == HCLGE_VF_VLAN_DEL_NO_FOUND) {
+                       dev_warn(&hdev->pdev->dev,
+                                "vlan %d filter is not in vf vlan table\n",
+                                vlan);
+                       return 0;
+               }
+
                dev_err(&hdev->pdev->dev,
                        "Kill vf vlan filter fail, ret =%d.\n",
                        req0->resp_code);