dpif: Allow execute to modify the packet.
authorJarno Rajahalme <jrajahalme@nicira.com>
Mon, 16 Dec 2013 16:14:52 +0000 (08:14 -0800)
committerJarno Rajahalme <jrajahalme@nicira.com>
Mon, 16 Dec 2013 16:14:52 +0000 (08:14 -0800)
commitda546e076495672ab67106bb6dbb42447c1a2d26
treea418b4f46bc2ca413c5ef87017b0c9c9d2c25e5d
parent881d47a9fa901e71953a34367e9cd9b1f0571808
dpif: Allow execute to modify the packet.

Allowing the packet to be modified by execution allows less data
copying for userspace action execution.  Some users of the
dpif_execute already expect that the packet may be modified.  This
patch makes this behavior uniform and makes the userspace datapath and
the execution helpers modify the packet as it is being executed.
Userspace action now steals the packet if given permission, as the
packet is normally not needed after it.  The only exception is the
sample action, and this is accounted for my keeping track of any
actions that could be following the userspace action.

The packet in dpif_upcall is changed from a pointer to a struct,
allowing the packet to be honest about it's headroom.  After this
change the packet can safely be pushed on over the precarious 4 byte
limit earlier allowed by the netlink data preceding the packet.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/dpif-linux.c
lib/dpif-netdev.c
lib/dpif-provider.h
lib/dpif.c
lib/dpif.h
lib/odp-execute.c
lib/odp-execute.h
lib/ofpbuf.c
lib/ofpbuf.h
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif-xlate.c