datapath: Get packet metadata from userspace in odp_packet_cmd_execute().
authorBen Pfaff <blp@nicira.com>
Wed, 1 Jun 2011 20:39:51 +0000 (13:39 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 1 Jun 2011 20:39:51 +0000 (13:39 -0700)
commit80e5eed9c2128f04a1d7da134120d96e961dbe10
treea7c0b2b2c47bec4277faa5b3b140b93945161374
parentb85145b59fab7efa236cdabd6ef0bda87f373d19
datapath: Get packet metadata from userspace in odp_packet_cmd_execute().

Until now, the tun_id and in_port have been lost when a packet is sent from
the kernel to userspace and then back to the kernel.  I didn't think that
this was a problem, but recent behavior made me look closer and see that
it makes a difference if sFlow is turned on or if an
ODP_ATTR_ACTION_CONTROLLER action is present.  We could possibly kluge
around those, but for future-proofing it seems better to pass the packet
metadata from userspace to the kernel.  That is what this commit does.

This commit introduces a user-kernel protocol break.  We could avoid that,
if it is desirable, by making ODP_PACKET_ATTR_KEY optional for
ODP_PACKET_CMD_EXECUTE commands.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c
datapath/flow.c
datapath/flow.h
lib/dpif-linux.c
lib/dpif-netdev.c
lib/dpif-provider.h
lib/dpif.c
lib/dpif.h
ofproto/ofproto-dpif.c