There's no point in executing an empty set of actions. dpif_execute() has had this optimization internally for a long time but dpif_operate() doesn't. For dpif_operate() it seems like a bigger win to optimize it at this higher level, avoiding adding any operation to the array at all.
Signed-off-by: Ben Pfaff <[email protected]> --- ofproto/ofproto-dpif.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 56c3baf..1bb9351 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -2573,7 +2573,8 @@ handle_flow_miss(struct ofproto_dpif *ofproto, struct flow_miss *miss, if (!execute_controller_action(ofproto, &facet->flow, subfacet->actions, - subfacet->actions_len, packet, true)) { + subfacet->actions_len, packet, true) + && subfacet->actions_len > 0) { struct flow_miss_op *op = &ops[(*n_ops)++]; struct dpif_execute *execute = &op->dpif_op.execute; -- 1.7.2.5 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
