aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2014-11-19 08:04:59 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-21 14:20:17 -0500
commit5968250c868ceee680aa77395b24e6ddcae17d36 (patch)
tree2275b3b1db667b6362d7b528a66337f5f1f96eb7 /net/openvswitch
parent62749e2cb3c4a7da3eaa5c01a7e787aebeff8536 (diff)
vlan: introduce *vlan_hwaccel_push_inside helpers
Use them to push skb->vlan_tci into the payload and avoid code duplication. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/datapath.c4
-rw-r--r--net/openvswitch/vport-gre.c12
2 files changed, 5 insertions, 11 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index c63e60e4d947..f37ca3e5824c 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -425,12 +425,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
425 if (!nskb) 425 if (!nskb)
426 return -ENOMEM; 426 return -ENOMEM;
427 427
428 nskb = vlan_insert_tag_set_proto(nskb, nskb->vlan_proto, 428 nskb = __vlan_hwaccel_push_inside(nskb);
429 vlan_tx_tag_get(nskb));
430 if (!nskb) 429 if (!nskb)
431 return -ENOMEM; 430 return -ENOMEM;
432 431
433 nskb->vlan_tci = 0;
434 skb = nskb; 432 skb = nskb;
435 } 433 }
436 434
diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
index 777cd8c71d53..6b69df545b1d 100644
--- a/net/openvswitch/vport-gre.c
+++ b/net/openvswitch/vport-gre.c
@@ -175,14 +175,10 @@ static int gre_tnl_send(struct vport *vport, struct sk_buff *skb)
175 goto err_free_rt; 175 goto err_free_rt;
176 } 176 }
177 177
178 if (vlan_tx_tag_present(skb)) { 178 skb = vlan_hwaccel_push_inside(skb);
179 skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, 179 if (unlikely(!skb)) {
180 vlan_tx_tag_get(skb)); 180 err = -ENOMEM;
181 if (unlikely(!skb) { 181 goto err_free_rt;
182 err = -ENOMEM;
183 goto err_free_rt;
184 }
185 skb->vlan_tci = 0;
186 } 182 }
187 183
188 /* Push Tunnel header. */ 184 /* Push Tunnel header. */