@@ -1646,13 +1646,12 @@ static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev,
1646
1646
return 0 ;
1647
1647
}
1648
1648
1649
- static int qeth_l3_rebuild_skb (struct qeth_card * card , struct sk_buff * skb ,
1650
- struct qeth_hdr * hdr , unsigned short * vlan_id )
1649
+ static void qeth_l3_rebuild_skb (struct qeth_card * card , struct sk_buff * skb ,
1650
+ struct qeth_hdr * hdr )
1651
1651
{
1652
1652
__u16 prot ;
1653
1653
struct iphdr * ip_hdr ;
1654
1654
unsigned char tg_addr [MAX_ADDR_LEN ];
1655
- int is_vlan = 0 ;
1656
1655
1657
1656
if (!(hdr -> hdr .l3 .flags & QETH_HDR_PASSTHRU )) {
1658
1657
prot = (hdr -> hdr .l3 .flags & QETH_HDR_IPV6 ) ? ETH_P_IPV6 :
@@ -1706,11 +1705,14 @@ static int qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
1706
1705
1707
1706
skb -> protocol = eth_type_trans (skb , card -> dev );
1708
1707
1709
- if (hdr -> hdr .l3 .ext_flags &
1710
- (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG )) {
1711
- * vlan_id = (hdr -> hdr .l3 .ext_flags & QETH_HDR_EXT_VLAN_FRAME ) ?
1712
- hdr -> hdr .l3 .vlan_id : * ((u16 * )& hdr -> hdr .l3 .dest_addr [12 ]);
1713
- is_vlan = 1 ;
1708
+ /* copy VLAN tag from hdr into skb */
1709
+ if (!card -> options .sniffer &&
1710
+ (hdr -> hdr .l3 .ext_flags & (QETH_HDR_EXT_VLAN_FRAME |
1711
+ QETH_HDR_EXT_INCLUDE_VLAN_TAG ))) {
1712
+ u16 tag = (hdr -> hdr .l3 .ext_flags & QETH_HDR_EXT_VLAN_FRAME ) ?
1713
+ hdr -> hdr .l3 .vlan_id :
1714
+ * ((u16 * )& hdr -> hdr .l3 .dest_addr [12 ]);
1715
+ __vlan_hwaccel_put_tag (skb , htons (ETH_P_8021Q ), tag );
1714
1716
}
1715
1717
1716
1718
if (card -> dev -> features & NETIF_F_RXCSUM ) {
@@ -1724,7 +1726,6 @@ static int qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
1724
1726
skb -> ip_summed = CHECKSUM_NONE ;
1725
1727
} else
1726
1728
skb -> ip_summed = CHECKSUM_NONE ;
1727
- return is_vlan ;
1728
1729
}
1729
1730
1730
1731
static int qeth_l3_process_inbound_buffer (struct qeth_card * card ,
@@ -1733,8 +1734,6 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
1733
1734
int work_done = 0 ;
1734
1735
struct sk_buff * skb ;
1735
1736
struct qeth_hdr * hdr ;
1736
- __u16 vlan_tag = 0 ;
1737
- int is_vlan ;
1738
1737
unsigned int len ;
1739
1738
__u16 magic ;
1740
1739
@@ -1764,12 +1763,8 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
1764
1763
card -> dev -> addr_len );
1765
1764
netif_receive_skb (skb );
1766
1765
} else {
1767
- is_vlan = qeth_l3_rebuild_skb (card , skb , hdr ,
1768
- & vlan_tag );
1766
+ qeth_l3_rebuild_skb (card , skb , hdr );
1769
1767
len = skb -> len ;
1770
- if (is_vlan && !card -> options .sniffer )
1771
- __vlan_hwaccel_put_tag (skb ,
1772
- htons (ETH_P_8021Q ), vlan_tag );
1773
1768
napi_gro_receive (& card -> napi , skb );
1774
1769
}
1775
1770
break ;
0 commit comments