diff options
author | Andy Zhou <azhou@ovn.org> | 2017-03-09 14:00:34 -0800 |
---|---|---|
committer | Andy Zhou <azhou@ovn.org> | 2017-03-10 17:36:18 -0800 |
commit | 889ee380c87259aef06c44eb1fe47b6c289e4165 (patch) | |
tree | 36cbccf2c39cd9d66bb379d9e48169dc55ce8a25 /ofproto | |
parent | b52ac6592fd675b665f8a35acda664b377197ffe (diff) | |
download | openvswitch-889ee380c87259aef06c44eb1fe47b6c289e4165.tar.gz |
ofproto-dpif-xlate: Avoid using sample action when nesting level is low
When datapath sample action only allow a small number of nested actions
(i.e. less than 3), do not translate the OpenFlow's 'clone' action
into datapath 'sample' action, since such translation would cause
datapath to reject the flow, with 'EOVERFLOW', when OVS is used to
implement the OVN pipeline, or more generally, when deeper nested
clone are expected.
Reported-by: Numan Siddique <nusiddiq@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/329586.html
Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Acked-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif-xlate.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 8ce6a5939..084368d6d 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -4798,13 +4798,20 @@ xlate_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc) /* Datapath clone action will make sure the pre clone packets * are used for actions after clone. Save and restore * ctx->base_flow to reflect this for the openflow pipeline. */ - struct flow old_base_flow = ctx->base_flow; if (ctx->xbridge->support.clone) { + struct flow old_base_flow = ctx->base_flow; compose_clone_action(ctx, oc); - } else { + ctx->base_flow = old_base_flow; + } else if (ctx->xbridge->support.sample_nesting > 3) { + /* Avoid generate sample action if datapath + * only allow small number of nesting. Deeper nesting + * can cause the datapath to reject the generated flow. */ + struct flow old_base_flow = ctx->base_flow; compose_clone_action_using_sample(ctx, oc); + ctx->base_flow = old_base_flow; + } else { + do_xlate_actions(oc->actions, ofpact_nest_get_action_len(oc), ctx); } - ctx->base_flow = old_base_flow; ofpbuf_uninit(&ctx->action_set); ctx->action_set = old_action_set; |