ofproto: Allow xlate_actions() to fail.
authorJarno Rajahalme <jarno@ovn.org>
Wed, 25 Nov 2015 23:19:37 +0000 (15:19 -0800)
committerJarno Rajahalme <jarno@ovn.org>
Wed, 25 Nov 2015 23:19:37 +0000 (15:19 -0800)
commitfff1b9c0e004f9cf516c40805d923cb444276933
treef1adf1b4a7386b74c6876d37041a49182562f6b2
parentd49b001d137eba8296d3f9581c91fea8067c4352
ofproto: Allow xlate_actions() to fail.

Sometimes xlate_actions() fails due to too deep recursion, too many
MPLS labels, or missing recirculation context.  Make xlate_actions()
clear out the produced odp actions in these cases to make it easy for
the caller to install a drop flow (instead or installing a flow with
partially translated actions).  Also, return a specific error code, so
that the error can be properly propagated where meaningful.

There are may cases in which the NORMAL action decides to drop the
packet.  Most of these are not, however, traslation errors, but just
reactions to malformed input. In these cases it is correct to make the
NORMAL action do nothing, but allow other actions in the pipeline (if
any) to take effect.

Before this patch it was possible that the revalidation installed a
flow with a recirculation ID with an invalid recirc ID (== 0), due to
the introduction of in-place modification in commit 43b2f131a229
(ofproto: Allow in-place modifications of datapath flows).

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto-dpif-xlate.h
ofproto/ofproto-dpif.c
tests/ofproto-dpif.at