Netdev List
 help / color / mirror / Atom feed
From: Salil Mehta <salil.mehta@huawei.com>
To: <davem@davemloft.net>
Cc: <salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<lipeng321@huawei.com>, <mehta.salil.lnk@gmail.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, Yunsheng Lin <linyunsheng@huawei.com>
Subject: [PATCH net-next 5/9] net: hns3: Fix for vf vlan delete failed problem
Date: Sun, 12 Aug 2018 10:47:34 +0100	[thread overview]
Message-ID: <20180812094738.14852-6-salil.mehta@huawei.com> (raw)
In-Reply-To: <20180812094738.14852-1-salil.mehta@huawei.com>

From: Yunsheng Lin <linyunsheng@huawei.com>

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: 9dba194574e3 ("{topost} net: hns3: fix for vlan table problem")
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>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 3b7cd6744280..c88f5e6a9b77 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -4684,9 +4684,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);
-- 
2.11.0

  parent reply	other threads:[~2018-08-12  9:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-12  9:47 [PATCH net-next 0/9] Misc bug fixes & small enhancements for HNS3 Driver Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 1/9] net: hns3: Add support for serdes loopback selftest Salil Mehta
2018-08-13 15:54   ` David Miller
2018-08-14 16:17     ` Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 2/9] net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 3/9] net: hns3: Fix for information of phydev lost problem when down/up Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 4/9] net: hns3: Fix for phy link issue when using marvell phy driver Salil Mehta
2018-08-12  9:47 ` Salil Mehta [this message]
2018-08-13 15:56   ` [PATCH net-next 5/9] net: hns3: Fix for vf vlan delete failed problem David Miller
2018-08-14 16:35     ` Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 6/9] net: hns3: Fix desc num set to default when setting channel Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 7/9] net: hns3: Remove tx ring BD len register in hns3_enet Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 8/9] net: hns3: Set tx ring' tc info when netdev is up Salil Mehta
2018-08-12  9:47 ` [PATCH net-next 9/9] net: hns3: Add vlan filter setting by ethtool command -K Salil Mehta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180812094738.14852-6-salil.mehta@huawei.com \
    --to=salil.mehta@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=linyunsheng@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=mehta.salil.lnk@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox