summaryrefslogtreecommitdiff
path: root/datapath/datapath.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2010-12-29 22:13:15 -0800
committerJesse Gross <jesse@nicira.com>2011-02-07 13:49:01 -0800
commit6ce39213456b27257acbaf146398dce26d1466b9 (patch)
tree3841453cfdde9261c94b343f341c6bc15e257ed3 /datapath/datapath.c
parent6e0ce48e27d5a845bdc8b57fb41bcec8a54f336a (diff)
downloadopenvswitch-6ce39213456b27257acbaf146398dce26d1466b9.tar.gz
datapath: Use vlan acceleration for vlan operations.
Using the kernel vlan acceleration has a number of benefits: it enables hardware tagging, allows usage of TSO and checksum offloading, and is generally easier to manipulate. This switches the vlan actions to use skb->vlan_tci field for any necessary changes. In places that do not support vlan acceleration in a way that we can use (in particular kernels before 2.6.37) we perform any necessary conversions, such as tagging and GSO before the packet leaves Open vSwitch. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath/datapath.c')
-rw-r--r--datapath/datapath.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index ba32e37fa..c48dc9dfb 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -483,6 +483,14 @@ static int queue_control_packets(struct datapath *dp, struct sk_buff *skb,
nskb = skb->next;
skb->next = NULL;
+ if (vlan_tx_tag_present(skb)) {
+ skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb));
+ if (unlikely(!skb)) {
+ err = -ENOMEM;
+ goto err_kfree_skbs;
+ }
+ }
+
len = sizeof(struct odp_header);
len += nla_total_size(skb->len);
len += nla_total_size(FLOW_BUFSIZE);