summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
80e5eed)
Before this patch, enqueue would reset the priority of a flow to
its original value instead of the value it had immediately before
the enqueue action.
Thus, these openflow actions:
set_queue:2,enqueue:1:1,output:1
Would get translated into these incorrect datapath actions:
set_priority(0x10003),set_priority(0x10002),1,pop_priority,1
Instead of these correct datapath actions:
set_priority(0x10003),set_priority(0x10002),1,set_priority(0x10003),1
A future patch will remove the redundant "set_priority(0x10003)".
Found by inspection.
int recurse; /* Recursion level, via xlate_table_action. */
int last_pop_priority; /* Offset in 'odp_actions' just past most
* recent ODP_ACTION_ATTR_SET_PRIORITY. */
int recurse; /* Recursion level, via xlate_table_action. */
int last_pop_priority; /* Offset in 'odp_actions' just past most
* recent ODP_ACTION_ATTR_SET_PRIORITY. */
+ uint32_t priority; /* Current flow priority. 0 if none. */
};
static void action_xlate_ctx_init(struct action_xlate_ctx *,
};
static void action_xlate_ctx_init(struct action_xlate_ctx *,
remove_pop_action(ctx);
nl_msg_put_u32(ctx->odp_actions, ODP_ACTION_ATTR_SET_PRIORITY, priority);
add_output_action(ctx, odp_port);
remove_pop_action(ctx);
nl_msg_put_u32(ctx->odp_actions, ODP_ACTION_ATTR_SET_PRIORITY, priority);
add_output_action(ctx, odp_port);
+
+ if (ctx->priority) {
+ nl_msg_put_u32(ctx->odp_actions, ODP_ACTION_ATTR_SET_PRIORITY,
+ ctx->priority);
+ } else {
+ add_pop_action(ctx);
+ }
/* Update NetFlow output port. */
if (ctx->nf_output_iface == NF_OUT_DROP) {
/* Update NetFlow output port. */
if (ctx->nf_output_iface == NF_OUT_DROP) {
+ ctx->priority = priority;
remove_pop_action(ctx);
nl_msg_put_u32(ctx->odp_actions, ODP_ACTION_ATTR_SET_PRIORITY, priority);
}
remove_pop_action(ctx);
nl_msg_put_u32(ctx->odp_actions, ODP_ACTION_ATTR_SET_PRIORITY, priority);
}
break;
case NXAST_POP_QUEUE:
break;
case NXAST_POP_QUEUE:
add_pop_action(ctx);
break;
add_pop_action(ctx);
break;
ctx->nf_output_iface = NF_OUT_DROP;
ctx->recurse = 0;
ctx->last_pop_priority = -1;
ctx->nf_output_iface = NF_OUT_DROP;
ctx->recurse = 0;
ctx->last_pop_priority = -1;
if (process_special(ctx->ofproto, &ctx->flow, ctx->packet)) {
ctx->may_set_up_flow = false;
if (process_special(ctx->ofproto, &ctx->flow, ctx->packet)) {
ctx->may_set_up_flow = false;