datapath: Use vlan deacceleration function in upcall.
authorJesse Gross <jesse@nicira.com>
Mon, 7 Feb 2011 23:57:09 +0000 (15:57 -0800)
committerJesse Gross <jesse@nicira.com>
Tue, 8 Feb 2011 00:15:04 +0000 (16:15 -0800)
vlan_deaccel_tag() was introduced to move a vlan tag from skb->vlan_tci
to the packet but there was still an open coded variant when doing
an upcall.  vlan_deaccel_tag() also clears skb->vlan_tci which is not
currently done but it makes no difference.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c

index c48dc9dfb5f42dcbe84346f99f89a8a08510199a..940a58142dbef97ad0881fdfc308f6640122d361 100644 (file)
@@ -51,6 +51,7 @@
 #include "flow.h"
 #include "loop_counter.h"
 #include "table.h"
+#include "vlan.h"
 #include "vport-internal_dev.h"
 
 int (*dp_ioctl_hook)(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -483,13 +484,9 @@ 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;
-                       }
-               }
+               err = vlan_deaccel_tag(skb);
+               if (unlikely(err))
+                       goto err_kfree_skbs;
 
                len = sizeof(struct odp_header);
                len += nla_total_size(skb->len);