2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 13:43:55 +08:00

be2net: Fix vlans_added counter

When a VLAN is added by user, adapter->vlans_added is incremented.
But if the VLAN is already programmed in HW, driver ends up
incrementing the counter wrongly.

Increment the counter only if VLAN is not already programmed in the HW.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vasundhara Volam 2014-03-11 18:53:08 +05:30 committed by David S. Miller
parent a5243dabb9
commit 48291c22b7

View File

@ -1138,7 +1138,10 @@ static int be_vlan_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
/* Packets with VID 0 are always received by Lancer by default */
if (lancer_chip(adapter) && vid == 0)
goto ret;
return status;
if (adapter->vlan_tag[vid])
return status;
adapter->vlan_tag[vid] = 1;
adapter->vlans_added++;
@ -1148,7 +1151,7 @@ static int be_vlan_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
adapter->vlans_added--;
adapter->vlan_tag[vid] = 0;
}
ret:
return status;
}