aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-07-15 01:49:06 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-15 01:49:06 -0400
commit6aa895b047720f71ec4eb11452f7c3ce8426941f (patch)
treeba52827c2e90de0678043ecf9d43208057d05da7 /net/core/skbuff.c
parent968edbe1c82f1a50d80225ed7e410aba419e55bf (diff)
vlan: Don't store VLAN tag in cb
Use a real skb member to store the skb to avoid clashes with qdiscs, which are allowed to use the cb area themselves. As currently only real devices that consume the skb set the NETIF_F_HW_VLAN_TX flag, no explicit invalidation is neccessary. The new member fills a hole on 64 bit, the skb layout changes from: __u32 mark; /* 172 4 */ sk_buff_data_t transport_header; /* 176 4 */ sk_buff_data_t network_header; /* 180 4 */ sk_buff_data_t mac_header; /* 184 4 */ sk_buff_data_t tail; /* 188 4 */ /* --- cacheline 3 boundary (192 bytes) --- */ sk_buff_data_t end; /* 192 4 */ /* XXX 4 bytes hole, try to pack */ to __u32 mark; /* 172 4 */ __u16 vlan_tci; /* 176 2 */ /* XXX 2 bytes hole, try to pack */ sk_buff_data_t transport_header; /* 180 4 */ sk_buff_data_t network_header; /* 184 4 */ Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7c571560e9d2..50a853f7cd8e 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -459,6 +459,8 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
459 new->tc_verd = old->tc_verd; 459 new->tc_verd = old->tc_verd;
460#endif 460#endif
461#endif 461#endif
462 new->vlan_tci = old->vlan_tci;
463
462 skb_copy_secmark(new, old); 464 skb_copy_secmark(new, old);
463} 465}
464 466
@@ -2286,6 +2288,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
2286 skb_copy_queue_mapping(nskb, skb); 2288 skb_copy_queue_mapping(nskb, skb);
2287 nskb->priority = skb->priority; 2289 nskb->priority = skb->priority;
2288 nskb->protocol = skb->protocol; 2290 nskb->protocol = skb->protocol;
2291 nskb->vlan_tci = skb->vlan_tci;
2289 nskb->dst = dst_clone(skb->dst); 2292 nskb->dst = dst_clone(skb->dst);
2290 memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); 2293 memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
2291 nskb->pkt_type = skb->pkt_type; 2294 nskb->pkt_type = skb->pkt_type;