diff options
author | Patrick McHardy <kaber@trash.net> | 2013-04-18 22:04:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-19 14:46:06 -0400 |
commit | 86a9bad3ab6b6f858fd4443b48738cabbb6d094c (patch) | |
tree | 21d41b1c81e0f3e53ac4004627a8c9588099fea1 | |
parent | 1fd9b1fc310314911f66d2f14a8e4f0ef37bf47b (diff) |
net: vlan: add protocol argument to packet tagging functions
Add a protocol argument to the VLAN packet tagging functions. In case of HW
tagging, we need that protocol available in the ndo_start_xmit functions,
so it is stored in a new field in the skb. The new field fits into a hole
(on 64 bit) and doesn't increase the sks's size.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
56 files changed, 107 insertions, 84 deletions
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index 67647e264611..418004c93feb 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c | |||
@@ -2948,7 +2948,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq) | |||
2948 | nes_debug(NES_DBG_CQ, "%s: Reporting stripped VLAN packet. Tag = 0x%04X\n", | 2948 | nes_debug(NES_DBG_CQ, "%s: Reporting stripped VLAN packet. Tag = 0x%04X\n", |
2949 | nesvnic->netdev->name, vlan_tag); | 2949 | nesvnic->netdev->name, vlan_tag); |
2950 | 2950 | ||
2951 | __vlan_hwaccel_put_tag(rx_skb, vlan_tag); | 2951 | __vlan_hwaccel_put_tag(rx_skb, htons(ETH_P_8021Q), vlan_tag); |
2952 | } | 2952 | } |
2953 | if (nes_use_lro) | 2953 | if (nes_use_lro) |
2954 | lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL); | 2954 | lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL); |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index f5e052723029..e02cc265723a 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -514,7 +514,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
514 | skb->dev = client_info->slave->dev; | 514 | skb->dev = client_info->slave->dev; |
515 | 515 | ||
516 | if (client_info->tag) { | 516 | if (client_info->tag) { |
517 | skb = vlan_put_tag(skb, client_info->vlan_id); | 517 | skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id); |
518 | if (!skb) { | 518 | if (!skb) { |
519 | pr_err("%s: Error: failed to insert VLAN tag\n", | 519 | pr_err("%s: Error: failed to insert VLAN tag\n", |
520 | client_info->slave->bond->dev->name); | 520 | client_info->slave->bond->dev->name); |
@@ -1014,7 +1014,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) | |||
1014 | continue; | 1014 | continue; |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | skb = vlan_put_tag(skb, vlan->vlan_id); | 1017 | skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vlan->vlan_id); |
1018 | if (!skb) { | 1018 | if (!skb) { |
1019 | pr_err("%s: Error: failed to insert VLAN tag\n", | 1019 | pr_err("%s: Error: failed to insert VLAN tag\n", |
1020 | bond->dev->name); | 1020 | bond->dev->name); |
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c index 839a96213742..144942f6372b 100644 --- a/drivers/net/ethernet/3com/typhoon.c +++ b/drivers/net/ethernet/3com/typhoon.c | |||
@@ -1690,7 +1690,7 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * read | |||
1690 | skb_checksum_none_assert(new_skb); | 1690 | skb_checksum_none_assert(new_skb); |
1691 | 1691 | ||
1692 | if (rx->rxStatus & TYPHOON_RX_VLAN) | 1692 | if (rx->rxStatus & TYPHOON_RX_VLAN) |
1693 | __vlan_hwaccel_put_tag(new_skb, | 1693 | __vlan_hwaccel_put_tag(new_skb, htons(ETH_P_8021Q), |
1694 | ntohl(rx->vlanTag) & 0xffff); | 1694 | ntohl(rx->vlanTag) & 0xffff); |
1695 | netif_receive_skb(new_skb); | 1695 | netif_receive_skb(new_skb); |
1696 | 1696 | ||
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c index cdbc5443ae3b..8b04bfc20cfb 100644 --- a/drivers/net/ethernet/adaptec/starfire.c +++ b/drivers/net/ethernet/adaptec/starfire.c | |||
@@ -1498,7 +1498,7 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
1498 | printk(KERN_DEBUG " netdev_rx() vlanid = %d\n", | 1498 | printk(KERN_DEBUG " netdev_rx() vlanid = %d\n", |
1499 | vlid); | 1499 | vlid); |
1500 | } | 1500 | } |
1501 | __vlan_hwaccel_put_tag(skb, vlid); | 1501 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlid); |
1502 | } | 1502 | } |
1503 | #endif /* VLAN_SUPPORT */ | 1503 | #endif /* VLAN_SUPPORT */ |
1504 | netif_receive_skb(skb); | 1504 | netif_receive_skb(skb); |
diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c index a7689d931053..b7894f8af9d1 100644 --- a/drivers/net/ethernet/alteon/acenic.c +++ b/drivers/net/ethernet/alteon/acenic.c | |||
@@ -2019,7 +2019,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) | |||
2019 | 2019 | ||
2020 | /* send it up */ | 2020 | /* send it up */ |
2021 | if ((bd_flags & BD_FLG_VLAN_TAG)) | 2021 | if ((bd_flags & BD_FLG_VLAN_TAG)) |
2022 | __vlan_hwaccel_put_tag(skb, retdesc->vlan); | 2022 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), retdesc->vlan); |
2023 | netif_rx(skb); | 2023 | netif_rx(skb); |
2024 | 2024 | ||
2025 | dev->stats.rx_packets++; | 2025 | dev->stats.rx_packets++; |
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c index 6bad84d6e2c4..8e6b665a6726 100644 --- a/drivers/net/ethernet/amd/amd8111e.c +++ b/drivers/net/ethernet/amd/amd8111e.c | |||
@@ -793,7 +793,7 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) | |||
793 | #if AMD8111E_VLAN_TAG_USED | 793 | #if AMD8111E_VLAN_TAG_USED |
794 | if (vtag == TT_VLAN_TAGGED){ | 794 | if (vtag == TT_VLAN_TAGGED){ |
795 | u16 vlan_tag = le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info); | 795 | u16 vlan_tag = le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info); |
796 | __vlan_hwaccel_put_tag(skb, vlan_tag); | 796 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); |
797 | } | 797 | } |
798 | #endif | 798 | #endif |
799 | netif_receive_skb(skb); | 799 | netif_receive_skb(skb); |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 3565255cdd81..0ba900762b13 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -1809,7 +1809,7 @@ rrs_checked: | |||
1809 | 1809 | ||
1810 | AT_TAG_TO_VLAN(rrs->vlan_tag, vlan); | 1810 | AT_TAG_TO_VLAN(rrs->vlan_tag, vlan); |
1811 | vlan = le16_to_cpu(vlan); | 1811 | vlan = le16_to_cpu(vlan); |
1812 | __vlan_hwaccel_put_tag(skb, vlan); | 1812 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan); |
1813 | } | 1813 | } |
1814 | netif_receive_skb(skb); | 1814 | netif_receive_skb(skb); |
1815 | 1815 | ||
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c index 598a61151668..0688bb82b442 100644 --- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c +++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c | |||
@@ -1435,7 +1435,7 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que, | |||
1435 | netdev_dbg(netdev, | 1435 | netdev_dbg(netdev, |
1436 | "RXD VLAN TAG<RRD>=0x%04x\n", | 1436 | "RXD VLAN TAG<RRD>=0x%04x\n", |
1437 | prrs->vtag); | 1437 | prrs->vtag); |
1438 | __vlan_hwaccel_put_tag(skb, vlan_tag); | 1438 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); |
1439 | } | 1439 | } |
1440 | netif_receive_skb(skb); | 1440 | netif_receive_skb(skb); |
1441 | 1441 | ||
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c index fd7d85044e4a..fa0915f3999b 100644 --- a/drivers/net/ethernet/atheros/atlx/atl1.c +++ b/drivers/net/ethernet/atheros/atlx/atl1.c | |||
@@ -2024,7 +2024,7 @@ rrd_ok: | |||
2024 | ((rrd->vlan_tag & 7) << 13) | | 2024 | ((rrd->vlan_tag & 7) << 13) | |
2025 | ((rrd->vlan_tag & 8) << 9); | 2025 | ((rrd->vlan_tag & 8) << 9); |
2026 | 2026 | ||
2027 | __vlan_hwaccel_put_tag(skb, vlan_tag); | 2027 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); |
2028 | } | 2028 | } |
2029 | netif_receive_skb(skb); | 2029 | netif_receive_skb(skb); |
2030 | 2030 | ||
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c index 6b2c08a89b7e..265ce1b752ed 100644 --- a/drivers/net/ethernet/atheros/atlx/atl2.c +++ b/drivers/net/ethernet/atheros/atlx/atl2.c | |||
@@ -452,7 +452,7 @@ static void atl2_intr_rx(struct atl2_adapter *adapter) | |||
452 | ((rxd->status.vtag&7) << 13) | | 452 | ((rxd->status.vtag&7) << 13) | |
453 | ((rxd->status.vtag&8) << 9); | 453 | ((rxd->status.vtag&8) << 9); |
454 | 454 | ||
455 | __vlan_hwaccel_put_tag(skb, vlan_tag); | 455 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); |
456 | } | 456 | } |
457 | netif_rx(skb); | 457 | netif_rx(skb); |
458 | netdev->stats.rx_bytes += rx_size; | 458 | netdev->stats.rx_bytes += rx_size; |
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index 42a8bc8df5dd..5d204492c603 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c | |||
@@ -3211,7 +3211,7 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) | |||
3211 | } | 3211 | } |
3212 | if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && | 3212 | if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && |
3213 | !(bp->rx_mode & BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG)) | 3213 | !(bp->rx_mode & BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG)) |
3214 | __vlan_hwaccel_put_tag(skb, rx_hdr->l2_fhdr_vlan_tag); | 3214 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rx_hdr->l2_fhdr_vlan_tag); |
3215 | 3215 | ||
3216 | skb->protocol = eth_type_trans(skb, bp->dev); | 3216 | skb->protocol = eth_type_trans(skb, bp->dev); |
3217 | 3217 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 352e58ede4d5..6b50443d3456 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -719,7 +719,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
719 | if (!bnx2x_fill_frag_skb(bp, fp, tpa_info, pages, | 719 | if (!bnx2x_fill_frag_skb(bp, fp, tpa_info, pages, |
720 | skb, cqe, cqe_idx)) { | 720 | skb, cqe, cqe_idx)) { |
721 | if (tpa_info->parsing_flags & PARSING_FLAGS_VLAN) | 721 | if (tpa_info->parsing_flags & PARSING_FLAGS_VLAN) |
722 | __vlan_hwaccel_put_tag(skb, tpa_info->vlan_tag); | 722 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tpa_info->vlan_tag); |
723 | bnx2x_gro_receive(bp, fp, skb); | 723 | bnx2x_gro_receive(bp, fp, skb); |
724 | } else { | 724 | } else { |
725 | DP(NETIF_MSG_RX_STATUS, | 725 | DP(NETIF_MSG_RX_STATUS, |
@@ -994,7 +994,7 @@ reuse_rx: | |||
994 | 994 | ||
995 | if (le16_to_cpu(cqe_fp->pars_flags.flags) & | 995 | if (le16_to_cpu(cqe_fp->pars_flags.flags) & |
996 | PARSING_FLAGS_VLAN) | 996 | PARSING_FLAGS_VLAN) |
997 | __vlan_hwaccel_put_tag(skb, | 997 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), |
998 | le16_to_cpu(cqe_fp->vlan_tag)); | 998 | le16_to_cpu(cqe_fp->vlan_tag)); |
999 | napi_gro_receive(&fp->napi, skb); | 999 | napi_gro_receive(&fp->napi, skb); |
1000 | 1000 | ||
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 0c22c9a059c4..ac83c87e0b1b 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -6715,7 +6715,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) | |||
6715 | 6715 | ||
6716 | if (desc->type_flags & RXD_FLAG_VLAN && | 6716 | if (desc->type_flags & RXD_FLAG_VLAN && |
6717 | !(tp->rx_mode & RX_MODE_KEEP_VLAN_TAG)) | 6717 | !(tp->rx_mode & RX_MODE_KEEP_VLAN_TAG)) |
6718 | __vlan_hwaccel_put_tag(skb, | 6718 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), |
6719 | desc->err_vlan & RXD_VLAN_MASK); | 6719 | desc->err_vlan & RXD_VLAN_MASK); |
6720 | 6720 | ||
6721 | napi_gro_receive(&tnapi->napi, skb); | 6721 | napi_gro_receive(&tnapi->napi, skb); |
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index c0bc44e51fa9..ce4a030d3d0c 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c | |||
@@ -610,7 +610,7 @@ bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget) | |||
610 | rcb->rxq->rx_bytes += length; | 610 | rcb->rxq->rx_bytes += length; |
611 | 611 | ||
612 | if (flags & BNA_CQ_EF_VLAN) | 612 | if (flags & BNA_CQ_EF_VLAN) |
613 | __vlan_hwaccel_put_tag(skb, ntohs(cmpl->vlan_tag)); | 613 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cmpl->vlan_tag)); |
614 | 614 | ||
615 | if (BNAD_RXBUF_IS_PAGE(unmap_q->type)) | 615 | if (BNAD_RXBUF_IS_PAGE(unmap_q->type)) |
616 | napi_gro_frags(&rx_ctrl->napi); | 616 | napi_gro_frags(&rx_ctrl->napi); |
diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c index f85e0659432b..8061fb0ef7ed 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c | |||
@@ -1386,7 +1386,7 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len) | |||
1386 | 1386 | ||
1387 | if (p->vlan_valid) { | 1387 | if (p->vlan_valid) { |
1388 | st->vlan_xtract++; | 1388 | st->vlan_xtract++; |
1389 | __vlan_hwaccel_put_tag(skb, ntohs(p->vlan)); | 1389 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(p->vlan)); |
1390 | } | 1390 | } |
1391 | netif_receive_skb(skb); | 1391 | netif_receive_skb(skb); |
1392 | } | 1392 | } |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c index 9d67eb794c4b..f12e6b85a653 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c | |||
@@ -2030,7 +2030,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq, | |||
2030 | 2030 | ||
2031 | if (p->vlan_valid) { | 2031 | if (p->vlan_valid) { |
2032 | qs->port_stats[SGE_PSTAT_VLANEX]++; | 2032 | qs->port_stats[SGE_PSTAT_VLANEX]++; |
2033 | __vlan_hwaccel_put_tag(skb, ntohs(p->vlan)); | 2033 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(p->vlan)); |
2034 | } | 2034 | } |
2035 | if (rq->polling) { | 2035 | if (rq->polling) { |
2036 | if (lro) | 2036 | if (lro) |
@@ -2132,7 +2132,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs, | |||
2132 | 2132 | ||
2133 | if (cpl->vlan_valid) { | 2133 | if (cpl->vlan_valid) { |
2134 | qs->port_stats[SGE_PSTAT_VLANEX]++; | 2134 | qs->port_stats[SGE_PSTAT_VLANEX]++; |
2135 | __vlan_hwaccel_put_tag(skb, ntohs(cpl->vlan)); | 2135 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cpl->vlan)); |
2136 | } | 2136 | } |
2137 | napi_gro_frags(&qs->napi); | 2137 | napi_gro_frags(&qs->napi); |
2138 | } | 2138 | } |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 8b47b253e204..2bfbb206b35a 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c | |||
@@ -1633,7 +1633,7 @@ static void do_gro(struct sge_eth_rxq *rxq, const struct pkt_gl *gl, | |||
1633 | skb->rxhash = (__force u32)pkt->rsshdr.hash_val; | 1633 | skb->rxhash = (__force u32)pkt->rsshdr.hash_val; |
1634 | 1634 | ||
1635 | if (unlikely(pkt->vlan_ex)) { | 1635 | if (unlikely(pkt->vlan_ex)) { |
1636 | __vlan_hwaccel_put_tag(skb, ntohs(pkt->vlan)); | 1636 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(pkt->vlan)); |
1637 | rxq->stats.vlan_ex++; | 1637 | rxq->stats.vlan_ex++; |
1638 | } | 1638 | } |
1639 | ret = napi_gro_frags(&rxq->rspq.napi); | 1639 | ret = napi_gro_frags(&rxq->rspq.napi); |
@@ -1705,7 +1705,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp, | |||
1705 | skb_checksum_none_assert(skb); | 1705 | skb_checksum_none_assert(skb); |
1706 | 1706 | ||
1707 | if (unlikely(pkt->vlan_ex)) { | 1707 | if (unlikely(pkt->vlan_ex)) { |
1708 | __vlan_hwaccel_put_tag(skb, ntohs(pkt->vlan)); | 1708 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(pkt->vlan)); |
1709 | rxq->stats.vlan_ex++; | 1709 | rxq->stats.vlan_ex++; |
1710 | } | 1710 | } |
1711 | netif_receive_skb(skb); | 1711 | netif_receive_skb(skb); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c index 61dfb2a47929..df296af20bd5 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c | |||
@@ -1482,7 +1482,8 @@ static void do_gro(struct sge_eth_rxq *rxq, const struct pkt_gl *gl, | |||
1482 | skb_record_rx_queue(skb, rxq->rspq.idx); | 1482 | skb_record_rx_queue(skb, rxq->rspq.idx); |
1483 | 1483 | ||
1484 | if (pkt->vlan_ex) { | 1484 | if (pkt->vlan_ex) { |
1485 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(pkt->vlan)); | 1485 | __vlan_hwaccel_put_tag(skb, cpu_to_be16(ETH_P_8021Q), |
1486 | be16_to_cpu(pkt->vlan)); | ||
1486 | rxq->stats.vlan_ex++; | 1487 | rxq->stats.vlan_ex++; |
1487 | } | 1488 | } |
1488 | ret = napi_gro_frags(&rxq->rspq.napi); | 1489 | ret = napi_gro_frags(&rxq->rspq.napi); |
@@ -1551,7 +1552,7 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, | |||
1551 | 1552 | ||
1552 | if (pkt->vlan_ex) { | 1553 | if (pkt->vlan_ex) { |
1553 | rxq->stats.vlan_ex++; | 1554 | rxq->stats.vlan_ex++; |
1554 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(pkt->vlan)); | 1555 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), be16_to_cpu(pkt->vlan)); |
1555 | } | 1556 | } |
1556 | 1557 | ||
1557 | netif_receive_skb(skb); | 1558 | netif_receive_skb(skb); |
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 05c1e59b6bff..635f55992d7e 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
@@ -1300,7 +1300,7 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq, | |||
1300 | } | 1300 | } |
1301 | 1301 | ||
1302 | if (vlan_stripped) | 1302 | if (vlan_stripped) |
1303 | __vlan_hwaccel_put_tag(skb, vlan_tci); | 1303 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci); |
1304 | 1304 | ||
1305 | if (netdev->features & NETIF_F_GRO) | 1305 | if (netdev->features & NETIF_F_GRO) |
1306 | napi_gro_receive(&enic->napi[q_number], skb); | 1306 | napi_gro_receive(&enic->napi[q_number], skb); |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index b41333184916..811d0a47d17a 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -771,7 +771,7 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, | |||
771 | 771 | ||
772 | if (vlan_tx_tag_present(skb)) { | 772 | if (vlan_tx_tag_present(skb)) { |
773 | vlan_tag = be_get_tx_vlan_tag(adapter, skb); | 773 | vlan_tag = be_get_tx_vlan_tag(adapter, skb); |
774 | __vlan_put_tag(skb, vlan_tag); | 774 | __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); |
775 | skb->vlan_tci = 0; | 775 | skb->vlan_tci = 0; |
776 | } | 776 | } |
777 | 777 | ||
@@ -1383,7 +1383,7 @@ static void be_rx_compl_process(struct be_rx_obj *rxo, | |||
1383 | 1383 | ||
1384 | 1384 | ||
1385 | if (rxcp->vlanf) | 1385 | if (rxcp->vlanf) |
1386 | __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag); | 1386 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rxcp->vlan_tag); |
1387 | 1387 | ||
1388 | netif_receive_skb(skb); | 1388 | netif_receive_skb(skb); |
1389 | } | 1389 | } |
@@ -1439,7 +1439,7 @@ void be_rx_compl_process_gro(struct be_rx_obj *rxo, struct napi_struct *napi, | |||
1439 | skb->rxhash = rxcp->rss_hash; | 1439 | skb->rxhash = rxcp->rss_hash; |
1440 | 1440 | ||
1441 | if (rxcp->vlanf) | 1441 | if (rxcp->vlanf) |
1442 | __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag); | 1442 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rxcp->vlan_tag); |
1443 | 1443 | ||
1444 | napi_gro_frags(napi); | 1444 | napi_gro_frags(napi); |
1445 | } | 1445 | } |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 8239dafdd8e7..59ad007dd5aa 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -4003,7 +4003,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter, u8 status, | |||
4003 | if (status & E1000_RXD_STAT_VP) { | 4003 | if (status & E1000_RXD_STAT_VP) { |
4004 | u16 vid = le16_to_cpu(vlan) & E1000_RXD_SPC_VLAN_MASK; | 4004 | u16 vid = le16_to_cpu(vlan) & E1000_RXD_SPC_VLAN_MASK; |
4005 | 4005 | ||
4006 | __vlan_hwaccel_put_tag(skb, vid); | 4006 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
4007 | } | 4007 | } |
4008 | napi_gro_receive(&adapter->napi, skb); | 4008 | napi_gro_receive(&adapter->napi, skb); |
4009 | } | 4009 | } |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 8c17f01a155f..da7f2fad5ba4 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -554,7 +554,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter, | |||
554 | skb->protocol = eth_type_trans(skb, netdev); | 554 | skb->protocol = eth_type_trans(skb, netdev); |
555 | 555 | ||
556 | if (staterr & E1000_RXD_STAT_VP) | 556 | if (staterr & E1000_RXD_STAT_VP) |
557 | __vlan_hwaccel_put_tag(skb, tag); | 557 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tag); |
558 | 558 | ||
559 | napi_gro_receive(&adapter->napi, skb); | 559 | napi_gro_receive(&adapter->napi, skb); |
560 | } | 560 | } |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index d13ea71c7c1f..9bf08b977daa 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -6683,7 +6683,7 @@ static void igb_process_skb_fields(struct igb_ring *rx_ring, | |||
6683 | else | 6683 | else |
6684 | vid = le16_to_cpu(rx_desc->wb.upper.vlan); | 6684 | vid = le16_to_cpu(rx_desc->wb.upper.vlan); |
6685 | 6685 | ||
6686 | __vlan_hwaccel_put_tag(skb, vid); | 6686 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
6687 | } | 6687 | } |
6688 | 6688 | ||
6689 | skb_record_rx_queue(skb, rx_ring->queue_index); | 6689 | skb_record_rx_queue(skb, rx_ring->queue_index); |
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index 3854fd698b85..93eb7ee06d3e 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c | |||
@@ -116,7 +116,7 @@ static void igbvf_receive_skb(struct igbvf_adapter *adapter, | |||
116 | else | 116 | else |
117 | vid = le16_to_cpu(vlan) & E1000_RXD_SPC_VLAN_MASK; | 117 | vid = le16_to_cpu(vlan) & E1000_RXD_SPC_VLAN_MASK; |
118 | if (test_bit(vid, adapter->active_vlans)) | 118 | if (test_bit(vid, adapter->active_vlans)) |
119 | __vlan_hwaccel_put_tag(skb, vid); | 119 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
120 | } | 120 | } |
121 | 121 | ||
122 | napi_gro_receive(&adapter->rx_ring->napi, skb); | 122 | napi_gro_receive(&adapter->rx_ring->napi, skb); |
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c index a32f274acd36..fce3e92f9d11 100644 --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c | |||
@@ -2082,8 +2082,8 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do) | |||
2082 | 2082 | ||
2083 | skb->protocol = eth_type_trans(skb, netdev); | 2083 | skb->protocol = eth_type_trans(skb, netdev); |
2084 | if (status & IXGB_RX_DESC_STATUS_VP) | 2084 | if (status & IXGB_RX_DESC_STATUS_VP) |
2085 | __vlan_hwaccel_put_tag(skb, | 2085 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), |
2086 | le16_to_cpu(rx_desc->special)); | 2086 | le16_to_cpu(rx_desc->special)); |
2087 | 2087 | ||
2088 | netif_receive_skb(skb); | 2088 | netif_receive_skb(skb); |
2089 | 2089 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 3becffc77321..6225f880a3f4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1491,7 +1491,7 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring, | |||
1491 | if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) && | 1491 | if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) && |
1492 | ixgbe_test_staterr(rx_desc, IXGBE_RXD_STAT_VP)) { | 1492 | ixgbe_test_staterr(rx_desc, IXGBE_RXD_STAT_VP)) { |
1493 | u16 vid = le16_to_cpu(rx_desc->wb.upper.vlan); | 1493 | u16 vid = le16_to_cpu(rx_desc->wb.upper.vlan); |
1494 | __vlan_hwaccel_put_tag(skb, vid); | 1494 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
1495 | } | 1495 | } |
1496 | 1496 | ||
1497 | skb_record_rx_queue(skb, rx_ring->queue_index); | 1497 | skb_record_rx_queue(skb, rx_ring->queue_index); |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 4bc1f84c9352..1f5166ad6bb5 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -291,7 +291,7 @@ static void ixgbevf_receive_skb(struct ixgbevf_q_vector *q_vector, | |||
291 | u16 tag = le16_to_cpu(rx_desc->wb.upper.vlan); | 291 | u16 tag = le16_to_cpu(rx_desc->wb.upper.vlan); |
292 | 292 | ||
293 | if (is_vlan && test_bit(tag & VLAN_VID_MASK, adapter->active_vlans)) | 293 | if (is_vlan && test_bit(tag & VLAN_VID_MASK, adapter->active_vlans)) |
294 | __vlan_hwaccel_put_tag(skb, tag); | 294 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tag); |
295 | 295 | ||
296 | if (!(adapter->flags & IXGBE_FLAG_IN_NETPOLL)) | 296 | if (!(adapter->flags & IXGBE_FLAG_IN_NETPOLL)) |
297 | napi_gro_receive(&q_vector->napi, skb); | 297 | napi_gro_receive(&q_vector->napi, skb); |
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index d28ce6f97172..070a6f1a0577 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
@@ -1059,7 +1059,7 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx) | |||
1059 | if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) { | 1059 | if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) { |
1060 | u16 vid = le16_to_cpu(rxdesc->descwb.vlan); | 1060 | u16 vid = le16_to_cpu(rxdesc->descwb.vlan); |
1061 | 1061 | ||
1062 | __vlan_hwaccel_put_tag(skb, vid); | 1062 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
1063 | NET_STAT(jme).rx_bytes += 4; | 1063 | NET_STAT(jme).rx_bytes += 4; |
1064 | } | 1064 | } |
1065 | jme->jme_rx(skb); | 1065 | jme->jme_rx(skb); |
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index bf9da1b7b090..256ae789c143 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c | |||
@@ -2713,7 +2713,7 @@ static void sky2_rx_tag(struct sky2_port *sky2, u16 length) | |||
2713 | struct sk_buff *skb; | 2713 | struct sk_buff *skb; |
2714 | 2714 | ||
2715 | skb = sky2->rx_ring[sky2->rx_next].skb; | 2715 | skb = sky2->rx_ring[sky2->rx_next].skb; |
2716 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(length)); | 2716 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), be16_to_cpu(length)); |
2717 | } | 2717 | } |
2718 | 2718 | ||
2719 | static void sky2_rx_hash(struct sky2_port *sky2, u32 status) | 2719 | static void sky2_rx_hash(struct sky2_port *sky2, u32 status) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index c7f856308e1a..4006f8857cb5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -673,7 +673,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
673 | cpu_to_be32(MLX4_CQE_VLAN_PRESENT_MASK)) { | 673 | cpu_to_be32(MLX4_CQE_VLAN_PRESENT_MASK)) { |
674 | u16 vid = be16_to_cpu(cqe->sl_vid); | 674 | u16 vid = be16_to_cpu(cqe->sl_vid); |
675 | 675 | ||
676 | __vlan_hwaccel_put_tag(gro_skb, vid); | 676 | __vlan_hwaccel_put_tag(gro_skb, htons(ETH_P_8021Q), vid); |
677 | } | 677 | } |
678 | 678 | ||
679 | if (dev->features & NETIF_F_RXHASH) | 679 | if (dev->features & NETIF_F_RXHASH) |
@@ -716,7 +716,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
716 | 716 | ||
717 | if (be32_to_cpu(cqe->vlan_my_qpn) & | 717 | if (be32_to_cpu(cqe->vlan_my_qpn) & |
718 | MLX4_CQE_VLAN_PRESENT_MASK) | 718 | MLX4_CQE_VLAN_PRESENT_MASK) |
719 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(cqe->sl_vid)); | 719 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), be16_to_cpu(cqe->sl_vid)); |
720 | 720 | ||
721 | /* Push it up the stack */ | 721 | /* Push it up the stack */ |
722 | netif_receive_skb(skb); | 722 | netif_receive_skb(skb); |
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index 46262ea610fd..7be9788ed0f6 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c | |||
@@ -1290,7 +1290,7 @@ myri10ge_vlan_rx(struct net_device *dev, void *addr, struct sk_buff *skb) | |||
1290 | skb->csum = csum_sub(skb->csum, vsum); | 1290 | skb->csum = csum_sub(skb->csum, vsum); |
1291 | } | 1291 | } |
1292 | /* pop tag */ | 1292 | /* pop tag */ |
1293 | __vlan_hwaccel_put_tag(skb, ntohs(veh->h_vlan_TCI)); | 1293 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(veh->h_vlan_TCI)); |
1294 | memmove(va + VLAN_HLEN, va, 2 * ETH_ALEN); | 1294 | memmove(va + VLAN_HLEN, va, 2 * ETH_ALEN); |
1295 | skb->len -= VLAN_HLEN; | 1295 | skb->len -= VLAN_HLEN; |
1296 | skb->data_len -= VLAN_HLEN; | 1296 | skb->data_len -= VLAN_HLEN; |
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c index 60267e91cbda..d3b47003a575 100644 --- a/drivers/net/ethernet/natsemi/ns83820.c +++ b/drivers/net/ethernet/natsemi/ns83820.c | |||
@@ -911,7 +911,7 @@ static void rx_irq(struct net_device *ndev) | |||
911 | unsigned short tag; | 911 | unsigned short tag; |
912 | 912 | ||
913 | tag = ntohs(extsts & EXTSTS_VTG_MASK); | 913 | tag = ntohs(extsts & EXTSTS_VTG_MASK); |
914 | __vlan_hwaccel_put_tag(skb, tag); | 914 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_IPV6), tag); |
915 | } | 915 | } |
916 | #endif | 916 | #endif |
917 | rx_rc = netif_rx(skb); | 917 | rx_rc = netif_rx(skb); |
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c index ec82d59b03ed..51b00941302c 100644 --- a/drivers/net/ethernet/neterion/s2io.c +++ b/drivers/net/ethernet/neterion/s2io.c | |||
@@ -8555,7 +8555,7 @@ static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag) | |||
8555 | 8555 | ||
8556 | skb->protocol = eth_type_trans(skb, dev); | 8556 | skb->protocol = eth_type_trans(skb, dev); |
8557 | if (vlan_tag && sp->vlan_strip_flag) | 8557 | if (vlan_tag && sp->vlan_strip_flag) |
8558 | __vlan_hwaccel_put_tag(skb, vlan_tag); | 8558 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); |
8559 | if (sp->config.napi) | 8559 | if (sp->config.napi) |
8560 | netif_receive_skb(skb); | 8560 | netif_receive_skb(skb); |
8561 | else | 8561 | else |
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c index a9396142201c..cbfaed5f2f8d 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c | |||
@@ -312,7 +312,7 @@ vxge_rx_complete(struct vxge_ring *ring, struct sk_buff *skb, u16 vlan, | |||
312 | 312 | ||
313 | if (ext_info->vlan && | 313 | if (ext_info->vlan && |
314 | ring->vlan_tag_strip == VXGE_HW_VPATH_RPA_STRIP_VLAN_TAG_ENABLE) | 314 | ring->vlan_tag_strip == VXGE_HW_VPATH_RPA_STRIP_VLAN_TAG_ENABLE) |
315 | __vlan_hwaccel_put_tag(skb, ext_info->vlan); | 315 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ext_info->vlan); |
316 | napi_gro_receive(ring->napi_p, skb); | 316 | napi_gro_receive(ring->napi_p, skb); |
317 | 317 | ||
318 | vxge_debug_entryexit(VXGE_TRACE, | 318 | vxge_debug_entryexit(VXGE_TRACE, |
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index fcad64081d74..b003fe53c8e2 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c | |||
@@ -2969,7 +2969,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit) | |||
2969 | vlanflags & NV_RX3_VLAN_TAG_PRESENT) { | 2969 | vlanflags & NV_RX3_VLAN_TAG_PRESENT) { |
2970 | u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK; | 2970 | u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK; |
2971 | 2971 | ||
2972 | __vlan_hwaccel_put_tag(skb, vid); | 2972 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
2973 | } | 2973 | } |
2974 | napi_gro_receive(&np->napi, skb); | 2974 | napi_gro_receive(&np->napi, skb); |
2975 | u64_stats_update_begin(&np->swstats_rx_syncp); | 2975 | u64_stats_update_begin(&np->swstats_rx_syncp); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index a85ca63a2c9e..56223a6aa408 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | |||
@@ -1050,7 +1050,7 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter, | |||
1050 | skb->protocol = eth_type_trans(skb, netdev); | 1050 | skb->protocol = eth_type_trans(skb, netdev); |
1051 | 1051 | ||
1052 | if (vid != 0xffff) | 1052 | if (vid != 0xffff) |
1053 | __vlan_hwaccel_put_tag(skb, vid); | 1053 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
1054 | 1054 | ||
1055 | napi_gro_receive(&sds_ring->napi, skb); | 1055 | napi_gro_receive(&sds_ring->napi, skb); |
1056 | 1056 | ||
@@ -1153,7 +1153,7 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter, | |||
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | if (vid != 0xffff) | 1155 | if (vid != 0xffff) |
1156 | __vlan_hwaccel_put_tag(skb, vid); | 1156 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
1157 | netif_receive_skb(skb); | 1157 | netif_receive_skb(skb); |
1158 | 1158 | ||
1159 | adapter->stats.lro_pkts++; | 1159 | adapter->stats.lro_pkts++; |
@@ -1518,7 +1518,7 @@ qlcnic_83xx_process_rcv(struct qlcnic_adapter *adapter, | |||
1518 | skb->protocol = eth_type_trans(skb, netdev); | 1518 | skb->protocol = eth_type_trans(skb, netdev); |
1519 | 1519 | ||
1520 | if (vid != 0xffff) | 1520 | if (vid != 0xffff) |
1521 | __vlan_hwaccel_put_tag(skb, vid); | 1521 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
1522 | 1522 | ||
1523 | napi_gro_receive(&sds_ring->napi, skb); | 1523 | napi_gro_receive(&sds_ring->napi, skb); |
1524 | 1524 | ||
@@ -1615,7 +1615,7 @@ qlcnic_83xx_process_lro(struct qlcnic_adapter *adapter, | |||
1615 | } | 1615 | } |
1616 | 1616 | ||
1617 | if (vid != 0xffff) | 1617 | if (vid != 0xffff) |
1618 | __vlan_hwaccel_put_tag(skb, vid); | 1618 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
1619 | 1619 | ||
1620 | netif_receive_skb(skb); | 1620 | netif_receive_skb(skb); |
1621 | 1621 | ||
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index a9016acc2d6a..44cf72ac2489 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -1498,7 +1498,7 @@ static void ql_process_mac_rx_gro_page(struct ql_adapter *qdev, | |||
1498 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1498 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1499 | skb_record_rx_queue(skb, rx_ring->cq_id); | 1499 | skb_record_rx_queue(skb, rx_ring->cq_id); |
1500 | if (vlan_id != 0xffff) | 1500 | if (vlan_id != 0xffff) |
1501 | __vlan_hwaccel_put_tag(skb, vlan_id); | 1501 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_id); |
1502 | napi_gro_frags(napi); | 1502 | napi_gro_frags(napi); |
1503 | } | 1503 | } |
1504 | 1504 | ||
@@ -1574,7 +1574,7 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev, | |||
1574 | 1574 | ||
1575 | skb_record_rx_queue(skb, rx_ring->cq_id); | 1575 | skb_record_rx_queue(skb, rx_ring->cq_id); |
1576 | if (vlan_id != 0xffff) | 1576 | if (vlan_id != 0xffff) |
1577 | __vlan_hwaccel_put_tag(skb, vlan_id); | 1577 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_id); |
1578 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) | 1578 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) |
1579 | napi_gro_receive(napi, skb); | 1579 | napi_gro_receive(napi, skb); |
1580 | else | 1580 | else |
@@ -1670,7 +1670,7 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev, | |||
1670 | 1670 | ||
1671 | skb_record_rx_queue(skb, rx_ring->cq_id); | 1671 | skb_record_rx_queue(skb, rx_ring->cq_id); |
1672 | if (vlan_id != 0xffff) | 1672 | if (vlan_id != 0xffff) |
1673 | __vlan_hwaccel_put_tag(skb, vlan_id); | 1673 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_id); |
1674 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) | 1674 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) |
1675 | napi_gro_receive(&rx_ring->napi, skb); | 1675 | napi_gro_receive(&rx_ring->napi, skb); |
1676 | else | 1676 | else |
@@ -1975,7 +1975,7 @@ static void ql_process_mac_split_rx_intr(struct ql_adapter *qdev, | |||
1975 | rx_ring->rx_bytes += skb->len; | 1975 | rx_ring->rx_bytes += skb->len; |
1976 | skb_record_rx_queue(skb, rx_ring->cq_id); | 1976 | skb_record_rx_queue(skb, rx_ring->cq_id); |
1977 | if ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V) && (vlan_id != 0)) | 1977 | if ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V) && (vlan_id != 0)) |
1978 | __vlan_hwaccel_put_tag(skb, vlan_id); | 1978 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_id); |
1979 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) | 1979 | if (skb->ip_summed == CHECKSUM_UNNECESSARY) |
1980 | napi_gro_receive(&rx_ring->napi, skb); | 1980 | napi_gro_receive(&rx_ring->napi, skb); |
1981 | else | 1981 | else |
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index 6d03b52e56f1..7d1fb9ad1296 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -431,7 +431,7 @@ static inline void cp_rx_skb (struct cp_private *cp, struct sk_buff *skb, | |||
431 | cp->dev->stats.rx_bytes += skb->len; | 431 | cp->dev->stats.rx_bytes += skb->len; |
432 | 432 | ||
433 | if (opts2 & RxVlanTagged) | 433 | if (opts2 & RxVlanTagged) |
434 | __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff)); | 434 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), swab16(opts2 & 0xffff)); |
435 | 435 | ||
436 | napi_gro_receive(&cp->napi, skb); | 436 | napi_gro_receive(&cp->napi, skb); |
437 | } | 437 | } |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 86d5d7909d10..c6dac38fd9cc 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -1843,7 +1843,7 @@ static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb) | |||
1843 | u32 opts2 = le32_to_cpu(desc->opts2); | 1843 | u32 opts2 = le32_to_cpu(desc->opts2); |
1844 | 1844 | ||
1845 | if (opts2 & RxVlanTag) | 1845 | if (opts2 & RxVlanTag) |
1846 | __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff)); | 1846 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), swab16(opts2 & 0xffff)); |
1847 | } | 1847 | } |
1848 | 1848 | ||
1849 | static int rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd) | 1849 | static int rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd) |
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c index f7050c573519..571452e786d5 100644 --- a/drivers/net/ethernet/tehuti/tehuti.c +++ b/drivers/net/ethernet/tehuti/tehuti.c | |||
@@ -1148,7 +1148,7 @@ NETIF_RX_MUX(struct bdx_priv *priv, u32 rxd_val1, u16 rxd_vlan, | |||
1148 | priv->ndev->name, | 1148 | priv->ndev->name, |
1149 | GET_RXD_VLAN_ID(rxd_vlan), | 1149 | GET_RXD_VLAN_ID(rxd_vlan), |
1150 | GET_RXD_VTAG(rxd_val1)); | 1150 | GET_RXD_VTAG(rxd_val1)); |
1151 | __vlan_hwaccel_put_tag(skb, GET_RXD_VLAN_TCI(rxd_vlan)); | 1151 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), GET_RXD_VLAN_TCI(rxd_vlan)); |
1152 | } | 1152 | } |
1153 | netif_receive_skb(skb); | 1153 | netif_receive_skb(skb); |
1154 | } | 1154 | } |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index c6014916f622..ca98acabf1b4 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -1936,7 +1936,7 @@ static int rhine_rx(struct net_device *dev, int limit) | |||
1936 | skb->protocol = eth_type_trans(skb, dev); | 1936 | skb->protocol = eth_type_trans(skb, dev); |
1937 | 1937 | ||
1938 | if (unlikely(desc_length & DescTag)) | 1938 | if (unlikely(desc_length & DescTag)) |
1939 | __vlan_hwaccel_put_tag(skb, vlan_tci); | 1939 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci); |
1940 | netif_receive_skb(skb); | 1940 | netif_receive_skb(skb); |
1941 | 1941 | ||
1942 | u64_stats_update_begin(&rp->rx_stats.syncp); | 1942 | u64_stats_update_begin(&rp->rx_stats.syncp); |
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index 91cd59146c24..fb6248956ee2 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c | |||
@@ -2080,7 +2080,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx) | |||
2080 | if (rd->rdesc0.RSR & RSR_DETAG) { | 2080 | if (rd->rdesc0.RSR & RSR_DETAG) { |
2081 | u16 vid = swab16(le16_to_cpu(rd->rdesc1.PQTAG)); | 2081 | u16 vid = swab16(le16_to_cpu(rd->rdesc1.PQTAG)); |
2082 | 2082 | ||
2083 | __vlan_hwaccel_put_tag(skb, vid); | 2083 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid); |
2084 | } | 2084 | } |
2085 | netif_rx(skb); | 2085 | netif_rx(skb); |
2086 | 2086 | ||
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c index b7e9cd7ca6d5..cc6dfe4102fd 100644 --- a/drivers/net/usb/cdc_mbim.c +++ b/drivers/net/usb/cdc_mbim.c | |||
@@ -221,7 +221,7 @@ static struct sk_buff *cdc_mbim_process_dgram(struct usbnet *dev, u8 *buf, size_ | |||
221 | 221 | ||
222 | /* map MBIM session to VLAN */ | 222 | /* map MBIM session to VLAN */ |
223 | if (tci) | 223 | if (tci) |
224 | vlan_put_tag(skb, tci); | 224 | vlan_put_tag(skb, htons(ETH_P_8021Q), tci); |
225 | err: | 225 | err: |
226 | return skb; | 226 | return skb; |
227 | } | 227 | } |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index 27b889992ab8..55a62cae2cb4 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -1293,7 +1293,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1293 | skb->protocol = eth_type_trans(skb, adapter->netdev); | 1293 | skb->protocol = eth_type_trans(skb, adapter->netdev); |
1294 | 1294 | ||
1295 | if (unlikely(rcd->ts)) | 1295 | if (unlikely(rcd->ts)) |
1296 | __vlan_hwaccel_put_tag(skb, rcd->tci); | 1296 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rcd->tci); |
1297 | 1297 | ||
1298 | if (adapter->netdev->features & NETIF_F_LRO) | 1298 | if (adapter->netdev->features & NETIF_F_LRO) |
1299 | netif_receive_skb(skb); | 1299 | netif_receive_skb(skb); |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 2c9fb65f8267..8086ff9988b1 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -157,9 +157,18 @@ static inline bool vlan_uses_dev(const struct net_device *dev) | |||
157 | } | 157 | } |
158 | #endif | 158 | #endif |
159 | 159 | ||
160 | static inline bool vlan_hw_offload_capable(netdev_features_t features, | ||
161 | __be16 proto) | ||
162 | { | ||
163 | if (proto == htons(ETH_P_8021Q) && features & NETIF_F_HW_VLAN_CTAG_TX) | ||
164 | return true; | ||
165 | return false; | ||
166 | } | ||
167 | |||
160 | /** | 168 | /** |
161 | * vlan_insert_tag - regular VLAN tag inserting | 169 | * vlan_insert_tag - regular VLAN tag inserting |
162 | * @skb: skbuff to tag | 170 | * @skb: skbuff to tag |
171 | * @vlan_proto: VLAN encapsulation protocol | ||
163 | * @vlan_tci: VLAN TCI to insert | 172 | * @vlan_tci: VLAN TCI to insert |
164 | * | 173 | * |
165 | * Inserts the VLAN tag into @skb as part of the payload | 174 | * Inserts the VLAN tag into @skb as part of the payload |
@@ -170,7 +179,8 @@ static inline bool vlan_uses_dev(const struct net_device *dev) | |||
170 | * | 179 | * |
171 | * Does not change skb->protocol so this function can be used during receive. | 180 | * Does not change skb->protocol so this function can be used during receive. |
172 | */ | 181 | */ |
173 | static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci) | 182 | static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, |
183 | __be16 vlan_proto, u16 vlan_tci) | ||
174 | { | 184 | { |
175 | struct vlan_ethhdr *veth; | 185 | struct vlan_ethhdr *veth; |
176 | 186 | ||
@@ -185,7 +195,7 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci) | |||
185 | skb->mac_header -= VLAN_HLEN; | 195 | skb->mac_header -= VLAN_HLEN; |
186 | 196 | ||
187 | /* first, the ethernet type */ | 197 | /* first, the ethernet type */ |
188 | veth->h_vlan_proto = htons(ETH_P_8021Q); | 198 | veth->h_vlan_proto = vlan_proto; |
189 | 199 | ||
190 | /* now, the TCI */ | 200 | /* now, the TCI */ |
191 | veth->h_vlan_TCI = htons(vlan_tci); | 201 | veth->h_vlan_TCI = htons(vlan_tci); |
@@ -204,24 +214,28 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci) | |||
204 | * Following the skb_unshare() example, in case of error, the calling function | 214 | * Following the skb_unshare() example, in case of error, the calling function |
205 | * doesn't have to worry about freeing the original skb. | 215 | * doesn't have to worry about freeing the original skb. |
206 | */ | 216 | */ |
207 | static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | 217 | static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, |
218 | __be16 vlan_proto, u16 vlan_tci) | ||
208 | { | 219 | { |
209 | skb = vlan_insert_tag(skb, vlan_tci); | 220 | skb = vlan_insert_tag(skb, vlan_proto, vlan_tci); |
210 | if (skb) | 221 | if (skb) |
211 | skb->protocol = htons(ETH_P_8021Q); | 222 | skb->protocol = vlan_proto; |
212 | return skb; | 223 | return skb; |
213 | } | 224 | } |
214 | 225 | ||
215 | /** | 226 | /** |
216 | * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting | 227 | * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting |
217 | * @skb: skbuff to tag | 228 | * @skb: skbuff to tag |
229 | * @vlan_proto: VLAN encapsulation protocol | ||
218 | * @vlan_tci: VLAN TCI to insert | 230 | * @vlan_tci: VLAN TCI to insert |
219 | * | 231 | * |
220 | * Puts the VLAN TCI in @skb->vlan_tci and lets the device do the rest | 232 | * Puts the VLAN TCI in @skb->vlan_tci and lets the device do the rest |
221 | */ | 233 | */ |
222 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, | 234 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, |
235 | __be16 vlan_proto, | ||
223 | u16 vlan_tci) | 236 | u16 vlan_tci) |
224 | { | 237 | { |
238 | skb->vlan_proto = vlan_proto; | ||
225 | skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci; | 239 | skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci; |
226 | return skb; | 240 | return skb; |
227 | } | 241 | } |
@@ -236,12 +250,13 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, | |||
236 | * Assumes skb->dev is the target that will xmit this frame. | 250 | * Assumes skb->dev is the target that will xmit this frame. |
237 | * Returns a VLAN tagged skb. | 251 | * Returns a VLAN tagged skb. |
238 | */ | 252 | */ |
239 | static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | 253 | static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, |
254 | __be16 vlan_proto, u16 vlan_tci) | ||
240 | { | 255 | { |
241 | if (skb->dev->features & NETIF_F_HW_VLAN_CTAG_TX) { | 256 | if (vlan_hw_offload_capable(skb->dev->features, vlan_proto)) { |
242 | return __vlan_hwaccel_put_tag(skb, vlan_tci); | 257 | return __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci); |
243 | } else { | 258 | } else { |
244 | return __vlan_put_tag(skb, vlan_tci); | 259 | return __vlan_put_tag(skb, vlan_proto, vlan_tci); |
245 | } | 260 | } |
246 | } | 261 | } |
247 | 262 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index e27d1c782f32..f5bed7b31954 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -387,6 +387,7 @@ typedef unsigned char *sk_buff_data_t; | |||
387 | * @secmark: security marking | 387 | * @secmark: security marking |
388 | * @mark: Generic packet mark | 388 | * @mark: Generic packet mark |
389 | * @dropcount: total number of sk_receive_queue overflows | 389 | * @dropcount: total number of sk_receive_queue overflows |
390 | * @vlan_proto: vlan encapsulation protocol | ||
390 | * @vlan_tci: vlan tag control information | 391 | * @vlan_tci: vlan tag control information |
391 | * @inner_transport_header: Inner transport layer header (encapsulation) | 392 | * @inner_transport_header: Inner transport layer header (encapsulation) |
392 | * @inner_network_header: Network layer header (encapsulation) | 393 | * @inner_network_header: Network layer header (encapsulation) |
@@ -465,6 +466,7 @@ struct sk_buff { | |||
465 | 466 | ||
466 | __u32 rxhash; | 467 | __u32 rxhash; |
467 | 468 | ||
469 | __be16 vlan_proto; | ||
468 | __u16 vlan_tci; | 470 | __u16 vlan_tci; |
469 | 471 | ||
470 | #ifdef CONFIG_NET_SCHED | 472 | #ifdef CONFIG_NET_SCHED |
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 4e4c360353ea..bdb0b9d2e9cf 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
@@ -8,11 +8,12 @@ | |||
8 | bool vlan_do_receive(struct sk_buff **skbp) | 8 | bool vlan_do_receive(struct sk_buff **skbp) |
9 | { | 9 | { |
10 | struct sk_buff *skb = *skbp; | 10 | struct sk_buff *skb = *skbp; |
11 | __be16 vlan_proto = skb->vlan_proto; | ||
11 | u16 vlan_id = skb->vlan_tci & VLAN_VID_MASK; | 12 | u16 vlan_id = skb->vlan_tci & VLAN_VID_MASK; |
12 | struct net_device *vlan_dev; | 13 | struct net_device *vlan_dev; |
13 | struct vlan_pcpu_stats *rx_stats; | 14 | struct vlan_pcpu_stats *rx_stats; |
14 | 15 | ||
15 | vlan_dev = vlan_find_dev(skb->dev, htons(ETH_P_8021Q), vlan_id); | 16 | vlan_dev = vlan_find_dev(skb->dev, vlan_proto, vlan_id); |
16 | if (!vlan_dev) | 17 | if (!vlan_dev) |
17 | return false; | 18 | return false; |
18 | 19 | ||
@@ -38,7 +39,8 @@ bool vlan_do_receive(struct sk_buff **skbp) | |||
38 | * original position later | 39 | * original position later |
39 | */ | 40 | */ |
40 | skb_push(skb, offset); | 41 | skb_push(skb, offset); |
41 | skb = *skbp = vlan_insert_tag(skb, skb->vlan_tci); | 42 | skb = *skbp = vlan_insert_tag(skb, skb->vlan_proto, |
43 | skb->vlan_tci); | ||
42 | if (!skb) | 44 | if (!skb) |
43 | return false; | 45 | return false; |
44 | skb_pull(skb, offset + VLAN_HLEN); | 46 | skb_pull(skb, offset + VLAN_HLEN); |
@@ -127,7 +129,7 @@ struct sk_buff *vlan_untag(struct sk_buff *skb) | |||
127 | 129 | ||
128 | vhdr = (struct vlan_hdr *) skb->data; | 130 | vhdr = (struct vlan_hdr *) skb->data; |
129 | vlan_tci = ntohs(vhdr->h_vlan_TCI); | 131 | vlan_tci = ntohs(vhdr->h_vlan_TCI); |
130 | __vlan_hwaccel_put_tag(skb, vlan_tci); | 132 | __vlan_hwaccel_put_tag(skb, skb->protocol, vlan_tci); |
131 | 133 | ||
132 | skb_pull_rcsum(skb, VLAN_HLEN); | 134 | skb_pull_rcsum(skb, VLAN_HLEN); |
133 | vlan_set_encap_proto(skb, vhdr); | 135 | vlan_set_encap_proto(skb, vhdr); |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index d7457b7e1b95..8af508536d36 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -167,7 +167,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb, | |||
167 | u16 vlan_tci; | 167 | u16 vlan_tci; |
168 | vlan_tci = vlan->vlan_id; | 168 | vlan_tci = vlan->vlan_id; |
169 | vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb); | 169 | vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb); |
170 | skb = __vlan_hwaccel_put_tag(skb, vlan_tci); | 170 | skb = __vlan_hwaccel_put_tag(skb, vlan->vlan_proto, vlan_tci); |
171 | } | 171 | } |
172 | 172 | ||
173 | skb->dev = vlan->real_dev; | 173 | skb->dev = vlan->real_dev; |
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 6a4f728680ae..379061c72549 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -341,7 +341,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac, | |||
341 | } | 341 | } |
342 | 342 | ||
343 | if (vid != -1) | 343 | if (vid != -1) |
344 | skb = vlan_insert_tag(skb, vid); | 344 | skb = vlan_insert_tag(skb, htons(ETH_P_8021Q), vid); |
345 | 345 | ||
346 | skb_reset_mac_header(skb); | 346 | skb_reset_mac_header(skb); |
347 | skb->protocol = eth_type_trans(skb, soft_iface); | 347 | skb->protocol = eth_type_trans(skb, soft_iface); |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index bd61bf5159c9..1ed75bfd8d1d 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -535,7 +535,7 @@ static struct net_device *brnf_get_logical_dev(struct sk_buff *skb, const struct | |||
535 | if (brnf_pass_vlan_indev == 0 || !vlan_tx_tag_present(skb)) | 535 | if (brnf_pass_vlan_indev == 0 || !vlan_tx_tag_present(skb)) |
536 | return br; | 536 | return br; |
537 | 537 | ||
538 | vlan = __vlan_find_dev_deep(br, htons(ETH_P_8021Q), | 538 | vlan = __vlan_find_dev_deep(br, skb->vlan_proto, |
539 | vlan_tx_tag_get(skb) & VLAN_VID_MASK); | 539 | vlan_tx_tag_get(skb) & VLAN_VID_MASK); |
540 | 540 | ||
541 | return vlan ? vlan : br; | 541 | return vlan ? vlan : br; |
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index c3076e2c4294..bd58b45f5f90 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c | |||
@@ -175,7 +175,7 @@ struct sk_buff *br_handle_vlan(struct net_bridge *br, | |||
175 | * mac header. | 175 | * mac header. |
176 | */ | 176 | */ |
177 | skb_push(skb, ETH_HLEN); | 177 | skb_push(skb, ETH_HLEN); |
178 | skb = __vlan_put_tag(skb, skb->vlan_tci); | 178 | skb = __vlan_put_tag(skb, skb->vlan_proto, skb->vlan_tci); |
179 | if (!skb) | 179 | if (!skb) |
180 | goto out; | 180 | goto out; |
181 | /* put skb->data back to where it was */ | 181 | /* put skb->data back to where it was */ |
@@ -217,7 +217,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, | |||
217 | /* PVID is set on this port. Any untagged ingress | 217 | /* PVID is set on this port. Any untagged ingress |
218 | * frame is considered to belong to this vlan. | 218 | * frame is considered to belong to this vlan. |
219 | */ | 219 | */ |
220 | __vlan_hwaccel_put_tag(skb, pvid); | 220 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid); |
221 | return true; | 221 | return true; |
222 | } | 222 | } |
223 | 223 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index 07a8e9dc43fc..3a12ee132b59 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2482,8 +2482,9 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
2482 | features = netif_skb_features(skb); | 2482 | features = netif_skb_features(skb); |
2483 | 2483 | ||
2484 | if (vlan_tx_tag_present(skb) && | 2484 | if (vlan_tx_tag_present(skb) && |
2485 | !(features & NETIF_F_HW_VLAN_CTAG_TX)) { | 2485 | !vlan_hw_offload_capable(features, skb->vlan_proto)) { |
2486 | skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb)); | 2486 | skb = __vlan_put_tag(skb, skb->vlan_proto, |
2487 | vlan_tx_tag_get(skb)); | ||
2487 | if (unlikely(!skb)) | 2488 | if (unlikely(!skb)) |
2488 | goto out; | 2489 | goto out; |
2489 | 2490 | ||
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 8de961e67cf7..209d84253dd5 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -383,8 +383,9 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, | |||
383 | if (__netif_tx_trylock(txq)) { | 383 | if (__netif_tx_trylock(txq)) { |
384 | if (!netif_xmit_stopped(txq)) { | 384 | if (!netif_xmit_stopped(txq)) { |
385 | if (vlan_tx_tag_present(skb) && | 385 | if (vlan_tx_tag_present(skb) && |
386 | !(netif_skb_features(skb) & NETIF_F_HW_VLAN_CTAG_TX)) { | 386 | !vlan_hw_offload_capable(netif_skb_features(skb), |
387 | skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb)); | 387 | skb->vlan_proto)) { |
388 | skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb)); | ||
388 | if (unlikely(!skb)) | 389 | if (unlikely(!skb)) |
389 | break; | 390 | break; |
390 | skb->vlan_tci = 0; | 391 | skb->vlan_tci = 0; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ba646145cd5c..a92d9e7d10f7 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -707,6 +707,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old) | |||
707 | new->tc_verd = old->tc_verd; | 707 | new->tc_verd = old->tc_verd; |
708 | #endif | 708 | #endif |
709 | #endif | 709 | #endif |
710 | new->vlan_proto = old->vlan_proto; | ||
710 | new->vlan_tci = old->vlan_tci; | 711 | new->vlan_tci = old->vlan_tci; |
711 | 712 | ||
712 | skb_copy_secmark(new, old); | 713 | skb_copy_secmark(new, old); |
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index d4d5363c7ba7..894b6cbdd929 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c | |||
@@ -98,7 +98,7 @@ static int pop_vlan(struct sk_buff *skb) | |||
98 | if (unlikely(err)) | 98 | if (unlikely(err)) |
99 | return err; | 99 | return err; |
100 | 100 | ||
101 | __vlan_hwaccel_put_tag(skb, ntohs(tci)); | 101 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(tci)); |
102 | return 0; | 102 | return 0; |
103 | } | 103 | } |
104 | 104 | ||
@@ -110,7 +110,7 @@ static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vla | |||
110 | /* push down current VLAN tag */ | 110 | /* push down current VLAN tag */ |
111 | current_tag = vlan_tx_tag_get(skb); | 111 | current_tag = vlan_tx_tag_get(skb); |
112 | 112 | ||
113 | if (!__vlan_put_tag(skb, current_tag)) | 113 | if (!__vlan_put_tag(skb, skb->vlan_proto, current_tag)) |
114 | return -ENOMEM; | 114 | return -ENOMEM; |
115 | 115 | ||
116 | if (skb->ip_summed == CHECKSUM_COMPLETE) | 116 | if (skb->ip_summed == CHECKSUM_COMPLETE) |
@@ -118,7 +118,7 @@ static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vla | |||
118 | + (2 * ETH_ALEN), VLAN_HLEN, 0)); | 118 | + (2 * ETH_ALEN), VLAN_HLEN, 0)); |
119 | 119 | ||
120 | } | 120 | } |
121 | __vlan_hwaccel_put_tag(skb, ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT); | 121 | __vlan_hwaccel_put_tag(skb, vlan->vlan_tpid, ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT); |
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index b7d0b7c3fe2c..7bb5d4f6bb90 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -401,7 +401,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex, | |||
401 | if (!nskb) | 401 | if (!nskb) |
402 | return -ENOMEM; | 402 | return -ENOMEM; |
403 | 403 | ||
404 | nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb)); | 404 | nskb = __vlan_put_tag(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb)); |
405 | if (!nskb) | 405 | if (!nskb) |
406 | return -ENOMEM; | 406 | return -ENOMEM; |
407 | 407 | ||