Commit 54a395b6 authored by liuzhongzhu's avatar liuzhongzhu Committed by David S. Miller

net: hns3: MAC table entry count function increases operation 0 value protection measures

When updating the available MAC VLAN table counts,
MAC VLAN table entry count function adds
operation 0 value protection measures.
Signed-off-by: default avatarliuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6104ca87
...@@ -5830,9 +5830,12 @@ static void hclge_update_umv_space(struct hclge_vport *vport, bool is_free) ...@@ -5830,9 +5830,12 @@ static void hclge_update_umv_space(struct hclge_vport *vport, bool is_free)
if (is_free) { if (is_free) {
if (vport->used_umv_num > hdev->priv_umv_size) if (vport->used_umv_num > hdev->priv_umv_size)
hdev->share_umv_size++; hdev->share_umv_size++;
vport->used_umv_num--;
if (vport->used_umv_num > 0)
vport->used_umv_num--;
} else { } else {
if (vport->used_umv_num >= hdev->priv_umv_size) if (vport->used_umv_num >= hdev->priv_umv_size &&
hdev->share_umv_size > 0)
hdev->share_umv_size--; hdev->share_umv_size--;
vport->used_umv_num++; vport->used_umv_num++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment