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 /net/openvswitch/actions.c | |
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>
Diffstat (limited to 'net/openvswitch/actions.c')
-rw-r--r-- | net/openvswitch/actions.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 | ||