dpif-netdev: Simplify code by removing dpif_netdev_validate_actions().
authorBen Pfaff <blp@nicira.com>
Wed, 5 Oct 2011 16:04:50 +0000 (09:04 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 11 Oct 2011 17:37:25 +0000 (10:37 -0700)
commit109ee2810ddf3c26d4c32e64208ca2033965d6db
treedc59309fe4991331f9a45bddba0a4f40a1a077ec
parent6d23c6f42206809f985d3fc7d95fca0589522836
dpif-netdev: Simplify code by removing dpif_netdev_validate_actions().

dpif_netdev_validate_actions() existed for three reasons.  First, it checked
that the actions were well-formed and valid.  This isn't really necessary,
because the actions are built internally by ofproto-dpif and will always be
well-formed.  (If not, that's a bug in ofproto-dpif.)  Second, it checks
whether the actions will modify (mutate) the data in the packet and reports
that to the caller, which can use it to optimize what it does.  However,
the only caller that used this was dpif_netdev_execute(), which is not a
fast-path (if dpif-netdev can be said to have a fast path at all).

Third, dpif_netdev_validate_actions() rejects certain actions that
dpif-netdev does not implement: OVS_ACTION_ATTR_SET_TUNNEL,
OVS_ACTION_ATTR_SET_PRIORITY, and OVS_ACTION_ATTR_POP_PRIORITY.  However,
this doesn't really seem necessary to me.  First, dpif-netdev can't support
tunnels in any case, so OVS_ACTION_ATTR_SET_TUNNEL shouldn't come up.
Second, the priority actions just aren't important enough to worry about;
they only affect QoS, which isn't really important with dpif-netdev since
it's going to be slow anyway.

So this commit just drops dpif_netdev_validate_actions() entirely.
lib/dpif-netdev.c