[ovs-dev] [PATCH v2 1/8] ofproto: Allow xlate_actions() to fail.

Jarno Rajahalme jarno at ovn.org
Tue Nov 24 19:26:34 UTC 2015


> On Nov 24, 2015, at 10:17 AM, Ben Pfaff <blp at ovn.org> wrote:
> 
> On Fri, Nov 06, 2015 at 04:10:48PM -0800, Jarno Rajahalme wrote:
>> Sometimes xlate_actions() fails due to too deep recursion, too many
>> MPLS labels, or missing recirculation context.  Make xlate_actions()
>> fail in these circumstances, so that we can install a drop flow
>> instead of a flow with partially translated actions.
>> 
>> Before this action 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 <jrajahalme at nicira.com>
> 
> Do the callers do something on failure that is significantly different
> from what they'd do on a success that returns no actions?  Flow
> translation is already hard enough for the clients to get right, and it
> would be ideal if they didn't have to be even more careful.

OK, I see that we should return with a “drop flow” (empty set of actions and xout.slow = false) when an translation error happens. ofproto_dpif_execute_actions could benefit from knowing that the translation failed, so that it can return an error rather than silently pretend that there were no actions. Same with trace, it will be valuable to be able to report a translation failure (and note that due to it a drop flow was returned).

  Jarno




More information about the dev mailing list