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,
linux-rdma@vger.kernel.org, linuxarm@huawei.com,
Mingguang Qu <qumingguang@huawei.com>
Subject: [PATCH V2 net 6/7] net: hns3: Fixes the default VLAN-id of PF
Date: Tue, 19 Sep 2017 17:17:15 +0100 [thread overview]
Message-ID: <20170919161716.92680-7-salil.mehta@huawei.com> (raw)
In-Reply-To: <20170919161716.92680-1-salil.mehta@huawei.com>
From: Lipeng <lipeng321@huawei.com>
When there is no vlan id in the packets, hardware will treat the vlan id
as 0 and look for the mac_vlan table. This patch set the default vlan id
of PF as 0. Without this config, it will fail when look for mac_vlan
table, and hardware will drop packets.
Fixes: 6427264ef330 ("net: hns3: Add HNS3 Acceleration Engine &
Compatibility Layer Support")
Signed-off-by: Mingguang Qu <qumingguang@huawei.com>
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 8e172af..74008ef 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3673,6 +3673,7 @@ static int hclge_init_vlan_config(struct hclge_dev *hdev)
{
#define HCLGE_VLAN_TYPE_VF_TABLE 0
#define HCLGE_VLAN_TYPE_PORT_TABLE 1
+ struct hnae3_handle *handle;
int ret;
ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_VLAN_TYPE_VF_TABLE,
@@ -3682,8 +3683,11 @@ static int hclge_init_vlan_config(struct hclge_dev *hdev)
ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_VLAN_TYPE_PORT_TABLE,
true);
+ if (ret)
+ return ret;
- return ret;
+ handle = &hdev->vport[0].nic;
+ return hclge_set_port_vlan_filter(handle, htons(ETH_P_8021Q), 0, false);
}
static int hclge_set_mtu(struct hnae3_handle *handle, int new_mtu)
--
2.7.4
next prev parent reply other threads:[~2017-09-19 16:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 16:17 [PATCH V2 net 0/7] Bug fixes for the HNS3 Ethernet Driver for Hip08 SoC Salil Mehta
2017-09-19 16:17 ` [PATCH V2 net 1/7] net: hns3: Fixes initialization of phy address from firmware Salil Mehta
2017-09-19 16:17 ` [PATCH V2 net 2/7] net: hns3: Fixes the command used to unmap ring from vector Salil Mehta
2017-09-19 16:17 ` [PATCH V2 net 3/7] net: hns3: Fixes ring-to-vector map-and-unmap command Salil Mehta
2017-09-19 16:17 ` [PATCH V2 net 4/7] net: hns3: Fixes the initialization of MAC address in hardware Salil Mehta
2017-09-19 16:17 ` [PATCH V2 net 5/7] net: hns3: Fixes the ether address copy with appropriate API Salil Mehta
2017-09-19 16:17 ` Salil Mehta [this message]
2017-09-19 16:17 ` [PATCH V2 net 7/7] net: hns3: Fixes the premature exit of loop when matching clients Salil Mehta
[not found] ` <20170919161716.92680-1-salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-09-19 23:07 ` [PATCH V2 net 0/7] Bug fixes for the HNS3 Ethernet Driver for Hip08 SoC David Miller
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=20170919161716.92680-7-salil.mehta@huawei.com \
--to=salil.mehta@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lipeng321@huawei.com \
--cc=mehta.salil.lnk@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=qumingguang@huawei.com \
--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;
as well as URLs for NNTP newsgroup(s).