aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r--net/8021q/vlan_dev.c41
1 files changed, 6 insertions, 35 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index c6678605fc03..c3adba9501cb 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -307,53 +307,31 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
307 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING 307 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING
308 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs... 308 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
309 */ 309 */
310
311 if (veth->h_vlan_proto != htons(ETH_P_8021Q) || 310 if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
312 vlan_dev_info(dev)->flags & VLAN_FLAG_REORDER_HDR) { 311 vlan_dev_info(dev)->flags & VLAN_FLAG_REORDER_HDR) {
313 int orig_headroom = skb_headroom(skb); 312 unsigned int orig_headroom = skb_headroom(skb);
314 u16 vlan_tci; 313 u16 vlan_tci;
315 314
316 /* This is not a VLAN frame...but we can fix that! */
317 vlan_dev_info(dev)->cnt_encap_on_xmit++; 315 vlan_dev_info(dev)->cnt_encap_on_xmit++;
318 316
319 pr_debug("%s: proto to encap: 0x%hx\n",
320 __func__, ntohs(veth->h_vlan_proto));
321 /* Construct the second two bytes. This field looks something
322 * like:
323 * usr_priority: 3 bits (high bits)
324 * CFI 1 bit
325 * VLAN ID 12 bits (low bits)
326 */
327 vlan_tci = vlan_dev_info(dev)->vlan_id; 317 vlan_tci = vlan_dev_info(dev)->vlan_id;
328 vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb); 318 vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
329
330 skb = __vlan_put_tag(skb, vlan_tci); 319 skb = __vlan_put_tag(skb, vlan_tci);
331 if (!skb) { 320 if (!skb) {
332 stats->tx_dropped++; 321 stats->tx_dropped++;
333 return 0; 322 return NETDEV_TX_OK;
334 } 323 }
335 324
336 if (orig_headroom < VLAN_HLEN) 325 if (orig_headroom < VLAN_HLEN)
337 vlan_dev_info(dev)->cnt_inc_headroom_on_tx++; 326 vlan_dev_info(dev)->cnt_inc_headroom_on_tx++;
338 } 327 }
339 328
340 pr_debug("%s: about to send skb: %p to dev: %s\n", 329 stats->tx_packets++;
341 __func__, skb, skb->dev->name);
342 pr_debug(" " MAC_FMT " " MAC_FMT " %4hx %4hx %4hx\n",
343 veth->h_dest[0], veth->h_dest[1], veth->h_dest[2],
344 veth->h_dest[3], veth->h_dest[4], veth->h_dest[5],
345 veth->h_source[0], veth->h_source[1], veth->h_source[2],
346 veth->h_source[3], veth->h_source[4], veth->h_source[5],
347 veth->h_vlan_proto, veth->h_vlan_TCI,
348 veth->h_vlan_encapsulated_proto);
349
350 stats->tx_packets++; /* for statics only */
351 stats->tx_bytes += skb->len; 330 stats->tx_bytes += skb->len;
352 331
353 skb->dev = vlan_dev_info(dev)->real_dev; 332 skb->dev = vlan_dev_info(dev)->real_dev;
354 dev_queue_xmit(skb); 333 dev_queue_xmit(skb);
355 334 return NETDEV_TX_OK;
356 return 0;
357} 335}
358 336
359static int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, 337static int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
@@ -362,12 +340,6 @@ static int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
362 struct net_device_stats *stats = &dev->stats; 340 struct net_device_stats *stats = &dev->stats;
363 u16 vlan_tci; 341 u16 vlan_tci;
364 342
365 /* Construct the second two bytes. This field looks something
366 * like:
367 * usr_priority: 3 bits (high bits)
368 * CFI 1 bit
369 * VLAN ID 12 bits (low bits)
370 */
371 vlan_tci = vlan_dev_info(dev)->vlan_id; 343 vlan_tci = vlan_dev_info(dev)->vlan_id;
372 vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb); 344 vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
373 skb = __vlan_hwaccel_put_tag(skb, vlan_tci); 345 skb = __vlan_hwaccel_put_tag(skb, vlan_tci);
@@ -377,8 +349,7 @@ static int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
377 349
378 skb->dev = vlan_dev_info(dev)->real_dev; 350 skb->dev = vlan_dev_info(dev)->real_dev;
379 dev_queue_xmit(skb); 351 dev_queue_xmit(skb);
380 352 return NETDEV_TX_OK;
381 return 0;
382} 353}
383 354
384static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu) 355static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu)