be2net: Fix to avoid hardware workaround when not needed
authorSarveshwar Bandi <sarveshwar.bandi@emulex.com>
Tue, 16 Jul 2013 07:14:02 +0000 (12:44 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Jul 2013 20:01:57 +0000 (13:01 -0700)
Hardware workaround requesting hardware to skip vlan insertion is necessary
only when umc or qnq is enabled. Enabling this workaround in other scenarios
could cause controller to stall.

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 2df48bb..181edb5 100644 (file)
@@ -782,16 +782,22 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
 
        if (vlan_tx_tag_present(skb))
                vlan_tag = be_get_tx_vlan_tag(adapter, skb);
-       else if (qnq_async_evt_rcvd(adapter) && adapter->pvid)
-               vlan_tag = adapter->pvid;
+
+       if (qnq_async_evt_rcvd(adapter) && adapter->pvid) {
+               if (!vlan_tag)
+                       vlan_tag = adapter->pvid;
+               /* f/w workaround to set skip_hw_vlan = 1, informs the F/W to
+                * skip VLAN insertion
+                */
+               if (skip_hw_vlan)
+                       *skip_hw_vlan = true;
+       }
 
        if (vlan_tag) {
                skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
                if (unlikely(!skb))
                        return skb;
                skb->vlan_tci = 0;
-               if (skip_hw_vlan)
-                       *skip_hw_vlan = true;
        }
 
        /* Insert the outer VLAN, if any */