From: Jesse Gross Date: Mon, 1 Aug 2011 07:35:20 +0000 (-0700) Subject: datapath: Set vport in skb when executed from userspace. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4015df5f24df80ad8ebf0ed965782b44964b4e;p=openvswitch datapath: Set vport in skb when executed from userspace. 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 Acked-by: Pravin Shelar --- diff --git a/datapath/datapath.c b/datapath/datapath.c index 79df5f89..232b2650 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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();