datapath: Add generic virtual port layer.
[openvswitch] / datapath / flow.c
index 9a94d0ba8d28971e5430e9bdc3dbc1c0657a03b9..8228da2e1c6ef9cf7c652a8fa5c60508daa8c797 100644 (file)
@@ -97,7 +97,6 @@ static inline struct ovs_tcphdr *ovs_tcp_hdr(const struct sk_buff *skb)
 
 void flow_used(struct sw_flow *flow, struct sk_buff *skb)
 {
-       unsigned long flags;
        u8 tcp_flags = 0;
 
        if (flow->key.dl_type == htons(ETH_P_IP) && iphdr_ok(skb)) {
@@ -109,12 +108,12 @@ void flow_used(struct sw_flow *flow, struct sk_buff *skb)
                }
        }
 
-       spin_lock_irqsave(&flow->lock, flags);
+       spin_lock_bh(&flow->lock);
        getnstimeofday(&flow->used);
        flow->packet_count++;
        flow->byte_count += skb->len;
        flow->tcp_flags |= tcp_flags;
-       spin_unlock_irqrestore(&flow->lock, flags);
+       spin_unlock_bh(&flow->lock);
 }
 
 struct sw_flow_actions *flow_actions_alloc(size_t n_actions)
@@ -202,8 +201,9 @@ int flow_extract(struct sk_buff *skb, u16 in_port, struct odp_flow_key *key)
        int nh_ofs;
 
        memset(key, 0, sizeof *key);
-       key->dl_vlan = htons(ODP_VLAN_NONE);
+       key->tun_id = OVS_CB(skb)->tun_id;
        key->in_port = in_port;
+       key->dl_vlan = htons(ODP_VLAN_NONE);
 
        if (skb->len < sizeof *eth)
                return 0;