datapath: Allow a packet with no input port to omit ODP_KEY_ATTR_IN_PORT.
authorBen Pfaff <blp@nicira.com>
Thu, 8 Sep 2011 23:36:57 +0000 (16:36 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 8 Sep 2011 23:36:57 +0000 (16:36 -0700)
commitd6b37e427aca7158f169ef8015be4139dea258d8
tree59d36e7bf282cd9f893e6844e3b85e81337bdba6
parent21fe5db0c9a8e92bbfce42da89ce20b826216fa1
datapath: Allow a packet with no input port to omit ODP_KEY_ATTR_IN_PORT.

When ovs-vswitchd executes actions on a synthesized packet, that is, on a
packet that is not being forwarded from any particular port but is being
generated by ovs-vswitchd itself or by an OpenFlow controller (using a
OFPT_PACKET_OUT message with an in_port of OFPP_NONE), there is no good
choice for the in_port to pass to the kernel in the flow in the
ODP_PACKET_CMD_EXECUTE message.  This commit allows ovs-vswitchd to omit
the in_port entirely in this case.

This fixes a bug in OFPT_PACKET_OUT: using an in_port of OFPP_NONE would
cause the packet to be dropped by the kernel, since that's an invalid
input port.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Reported-by: Aaron Rosen <arosen@clemson.edu>
datapath/flow.c
datapath/flow.h
lib/dpif-netdev.c
lib/odp-util.c