Skip to content

Commit 5e43aef

Browse files
321lipengdavem330
authored andcommitted
net: hns3: Fixes the default VLAN-id of PF
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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fbbb153 commit 5e43aef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3673,6 +3673,7 @@ static int hclge_init_vlan_config(struct hclge_dev *hdev)
36733673
{
36743674
#define HCLGE_VLAN_TYPE_VF_TABLE 0
36753675
#define HCLGE_VLAN_TYPE_PORT_TABLE 1
3676+
struct hnae3_handle *handle;
36763677
int ret;
36773678

36783679
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)
36823683

36833684
ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_VLAN_TYPE_PORT_TABLE,
36843685
true);
3686+
if (ret)
3687+
return ret;
36853688

3686-
return ret;
3689+
handle = &hdev->vport[0].nic;
3690+
return hclge_set_port_vlan_filter(handle, htons(ETH_P_8021Q), 0, false);
36873691
}
36883692

36893693
static int hclge_set_mtu(struct hnae3_handle *handle, int new_mtu)

0 commit comments

Comments
 (0)