tunneling: Add support for tunnel ID.
[sliver-openvswitch.git] / datapath / actions.c
index bef7d10..1032461 100644 (file)
@@ -58,6 +58,11 @@ make_writable(struct sk_buff *skb, unsigned min_headroom, gfp_t gfp)
        return NULL;
 }
 
+static void set_tunnel(struct sk_buff *skb, struct odp_flow_key *key,
+                      __be32 tun_id)
+{
+       OVS_CB(skb)->tun_id = key->tun_id = tun_id;
+}
 
 static struct sk_buff *
 vlan_pull_tag(struct sk_buff *skb)
@@ -477,6 +482,8 @@ int execute_actions(struct datapath *dp, struct sk_buff *skb,
                }
        }
 
+       OVS_CB(skb)->tun_id = 0;
+
        for (; n_actions > 0; a++, n_actions--) {
                WARN_ON_ONCE(skb_shared(skb));
                if (prev_port != -1) {
@@ -502,6 +509,10 @@ int execute_actions(struct datapath *dp, struct sk_buff *skb,
                        }
                        break;
 
+               case ODPAT_SET_TUNNEL:
+                       set_tunnel(skb, key, a->tunnel.tun_id);
+                       break;
+
                case ODPAT_SET_VLAN_VID:
                case ODPAT_SET_VLAN_PCP:
                        skb = modify_vlan_tci(dp, skb, key, a, n_actions, gfp);