datapath: Set vport in skb when executed from userspace.
authorJesse Gross <jesse@nicira.com>
Mon, 1 Aug 2011 07:35:20 +0000 (00:35 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 14 Sep 2011 19:54:07 +0000 (12:54 -0700)
Currently, the OVS_CB(skb)->vport member is never initialized for
packets coming from userspace.  This means that they can never be
sampled by sFlow and generally violates our principle that userspace
packets should be made to look the same as others.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin Shelar <pshelar@nicira.com>
datapath/datapath.c

index 79df5f8..232b265 100644 (file)
@@ -687,6 +687,11 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
        err = -ENODEV;
        if (!dp)
                goto err_unlock;
+
+       if (flow->key.eth.in_port < DP_MAX_PORTS)
+               OVS_CB(packet)->vport = get_vport_protected(dp,
+                                                       flow->key.eth.in_port);
+
        err = execute_actions(dp, packet);
        rcu_read_unlock();