aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@emulex.com>2013-04-24 07:52:28 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-24 19:37:21 -0400
commit1297f9db4fe8b5c7d77e8da71c2a21ea2d8076ba (patch)
tree65a645418bbd8c0e41202bb948e2d71e29e4285c /drivers/net/ethernet/emulex
parent60d509fa6a9c4653a86ad830e4c4b30360b23f0e (diff)
be2net: Remove an incorrect pvid check in Tx
To work-around a HW bug that corrupts certain packets while inserting a pvid, the driver needs to invoke a special hack in firmware to avoid the VLAN tagging in the HW. Since this logic is missing from the driver, removing the check for pvid. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 2886c9b63f90..a254942ed5a6 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -626,11 +626,6 @@ static inline u16 be_get_tx_vlan_tag(struct be_adapter *adapter,
626 return vlan_tag; 626 return vlan_tag;
627} 627}
628 628
629static int be_vlan_tag_chk(struct be_adapter *adapter, struct sk_buff *skb)
630{
631 return vlan_tx_tag_present(skb) || adapter->pvid;
632}
633
634static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr, 629static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
635 struct sk_buff *skb, u32 wrb_cnt, u32 len) 630 struct sk_buff *skb, u32 wrb_cnt, u32 len)
636{ 631{
@@ -781,11 +776,10 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
781 eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ? 776 eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ?
782 VLAN_ETH_HLEN : ETH_HLEN; 777 VLAN_ETH_HLEN : ETH_HLEN;
783 778
784 /* HW has a bug which considers padding bytes as legal 779 /* For padded packets, BE HW modifies tot_len field in IP header
785 * and modifies the IPv4 hdr's 'tot_len' field 780 * incorrecly when VLAN tag is inserted by HW.
786 */ 781 */
787 if (skb->len <= 60 && be_vlan_tag_chk(adapter, skb) && 782 if (skb->len <= 60 && vlan_tx_tag_present(skb) && is_ipv4_pkt(skb)) {
788 is_ipv4_pkt(skb)) {
789 ip = (struct iphdr *)ip_hdr(skb); 783 ip = (struct iphdr *)ip_hdr(skb);
790 pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len)); 784 pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
791 } 785 }
@@ -795,7 +789,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
795 * Manually insert VLAN in pkt. 789 * Manually insert VLAN in pkt.
796 */ 790 */
797 if (skb->ip_summed != CHECKSUM_PARTIAL && 791 if (skb->ip_summed != CHECKSUM_PARTIAL &&
798 be_vlan_tag_chk(adapter, skb)) { 792 vlan_tx_tag_present(skb)) {
799 skb = be_insert_vlan_in_pkt(adapter, skb); 793 skb = be_insert_vlan_in_pkt(adapter, skb);
800 if (unlikely(!skb)) 794 if (unlikely(!skb))
801 goto tx_drop; 795 goto tx_drop;