Commit 86a9bad3 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1fd9b1fc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2948,7 +2948,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
					nes_debug(NES_DBG_CQ, "%s: Reporting stripped VLAN packet. Tag = 0x%04X\n",
					nes_debug(NES_DBG_CQ, "%s: Reporting stripped VLAN packet. Tag = 0x%04X\n",
							nesvnic->netdev->name, vlan_tag);
							nesvnic->netdev->name, vlan_tag);


					__vlan_hwaccel_put_tag(rx_skb, vlan_tag);
					__vlan_hwaccel_put_tag(rx_skb, htons(ETH_P_8021Q), vlan_tag);
				}
				}
				if (nes_use_lro)
				if (nes_use_lro)
					lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL);
					lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL);
+2 −2
Original line number Original line Diff line number Diff line
@@ -514,7 +514,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)
		skb->dev = client_info->slave->dev;
		skb->dev = client_info->slave->dev;


		if (client_info->tag) {
		if (client_info->tag) {
			skb = vlan_put_tag(skb, client_info->vlan_id);
			skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id);
			if (!skb) {
			if (!skb) {
				pr_err("%s: Error: failed to insert VLAN tag\n",
				pr_err("%s: Error: failed to insert VLAN tag\n",
				       client_info->slave->bond->dev->name);
				       client_info->slave->bond->dev->name);
@@ -1014,7 +1014,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
				continue;
				continue;
			}
			}


			skb = vlan_put_tag(skb, vlan->vlan_id);
			skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vlan->vlan_id);
			if (!skb) {
			if (!skb) {
				pr_err("%s: Error: failed to insert VLAN tag\n",
				pr_err("%s: Error: failed to insert VLAN tag\n",
				       bond->dev->name);
				       bond->dev->name);
+1 −1
Original line number Original line Diff line number Diff line
@@ -1690,7 +1690,7 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * read
			skb_checksum_none_assert(new_skb);
			skb_checksum_none_assert(new_skb);


		if (rx->rxStatus & TYPHOON_RX_VLAN)
		if (rx->rxStatus & TYPHOON_RX_VLAN)
			__vlan_hwaccel_put_tag(new_skb,
			__vlan_hwaccel_put_tag(new_skb, htons(ETH_P_8021Q),
					       ntohl(rx->vlanTag) & 0xffff);
					       ntohl(rx->vlanTag) & 0xffff);
		netif_receive_skb(new_skb);
		netif_receive_skb(new_skb);


+1 −1
Original line number Original line Diff line number Diff line
@@ -1498,7 +1498,7 @@ static int __netdev_rx(struct net_device *dev, int *quota)
				printk(KERN_DEBUG "  netdev_rx() vlanid = %d\n",
				printk(KERN_DEBUG "  netdev_rx() vlanid = %d\n",
				       vlid);
				       vlid);
			}
			}
			__vlan_hwaccel_put_tag(skb, vlid);
			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlid);
		}
		}
#endif /* VLAN_SUPPORT */
#endif /* VLAN_SUPPORT */
		netif_receive_skb(skb);
		netif_receive_skb(skb);
+1 −1
Original line number Original line Diff line number Diff line
@@ -2019,7 +2019,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)


		/* send it up */
		/* send it up */
		if ((bd_flags & BD_FLG_VLAN_TAG))
		if ((bd_flags & BD_FLG_VLAN_TAG))
			__vlan_hwaccel_put_tag(skb, retdesc->vlan);
			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), retdesc->vlan);
		netif_rx(skb);
		netif_rx(skb);


		dev->stats.rx_packets++;
		dev->stats.rx_packets++;
Loading