summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasundhara Volam <vasundhara.volam@emulex.com>2014-03-11 17:23:08 +0400
committerDavid S. Miller <davem@davemloft.net>2014-03-13 00:19:48 +0400
commit48291c22b75adbbd15227070088c761c04e48a3b (patch)
tree555bea97f65d886704a22730ee7b3cbf366a5389
parenta5243dabb95c51a4b2dce3f7e4f3ced57d2c5742 (diff)
downloadlinux-48291c22b75adbbd15227070088c761c04e48a3b.tar.xz
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>
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index fc44bb331717..41736937e040 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -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;
}