From: Ben Pfaff Date: Mon, 26 Dec 2011 22:40:54 +0000 (-0800) Subject: ofproto-dpif: Omit "execute" operation entirely when there are no actions. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=968131c18090916ec30738d1ff8c1725bb744a30;p=openvswitch ofproto-dpif: Omit "execute" operation entirely when there are no actions. 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 --- diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index eabce4e0..031aa71e 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;