提交 6a10e967 编写于 作者: G Guojia Liao 提交者: Xie XiuQi

net: hns3: swaps sequence between remove and add when modifying port base vlan

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

When modified the port base vlan tag, we need to add a new vlan tag and
remove the old vlan tag. In original codes, removing the tag action
was before adding the new tag. Onece the new tag added failed,
if would cause the old tag lost. So we change the sequence.

Fixes : 18fb5b0b985d ("After the vf is abnormal, delete the entries
remaining in the chip.")
Feature or Bugfix:Bugfix
Signed-off-by: NGuojia Liao <liaoguojia@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ef63f664
...@@ -8407,13 +8407,24 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state, ...@@ -8407,13 +8407,24 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
return ret; return ret;
if (state == HNAE3_PORT_BASE_VLAN_MODIFY) { if (state == HNAE3_PORT_BASE_VLAN_MODIFY) {
hclge_set_vlan_filter_hw(hdev, old_vlan_info->vlan_proto, /* add new VLAN tag */
ret = hclge_set_vlan_filter_hw(hdev,
htons(vlan_info->vlan_proto),
vport->vport_id,
vlan_info->vlan_tag,
false);
if (ret)
return ret;
/* remove old VLAN tag */
ret = hclge_set_vlan_filter_hw(hdev,
htons(old_vlan_info->vlan_proto),
vport->vport_id, vport->vport_id,
old_vlan_info->vlan_tag, old_vlan_info->vlan_tag,
true); true);
hclge_set_vlan_filter_hw(hdev, vlan_info->vlan_proto, if (ret)
vport->vport_id, vlan_info->vlan_tag, return ret;
false);
goto update; goto update;
} }
...@@ -8422,7 +8433,7 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state, ...@@ -8422,7 +8433,7 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
if (ret) if (ret)
return ret; return ret;
/* update state only when disable/enable port base vlan */ /* update state only when disable/enable port based VLAN */
vport->port_base_vlan_cfg.state = state; vport->port_base_vlan_cfg.state = state;
if (state == HNAE3_PORT_BASE_VLAN_DISABLE) if (state == HNAE3_PORT_BASE_VLAN_DISABLE)
nic->port_base_vlan_state = HNAE3_PORT_BASE_VLAN_DISABLE; nic->port_base_vlan_state = HNAE3_PORT_BASE_VLAN_DISABLE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册