Skip to content

Commit

Permalink
ofproto-dpif-xlate: Avoid using sample action when nesting level is low
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
azhou-nicira committed Mar 11, 2017
1 parent b52ac65 commit 889ee38
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ofproto/ofproto-dpif-xlate.c
Expand Up @@ -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;
Expand Down

0 comments on commit 889ee38

Please sign in to comment.