Commit
968131c1809 (ofproto-dpif: Omit "execute" operation entirely when
there are no actions.) introduced an optimization for the case where a
flow translated to ODP actions had no actions at all (i.e. the packet is
to be dropped). It also introduced a memory leak (the packet was not
freed).
Commit
999fba59afd (ofproto-dpif: Implement PACKET_IN in userspace.)
inadvertently removed the optimization and as a side effect fixed the
memory leak.
This commit restores the optimization but not the memory leak.
Signed-off-by: Ben Pfaff <blp@nicira.com>
struct flow_miss_op *op;
struct dpif_execute *execute;
- list_remove(&packet->list_node);
ofproto->n_matches++;
if (facet->rule->up.cr.priority == FAIL_OPEN_PRIORITY) {
dpif_flow_stats_extract(&facet->flow, packet, &stats);
subfacet_update_stats(subfacet, &stats);
+ if (!subfacet->actions_len) {
+ /* No actions to execute, so skip talking to the dpif. */
+ continue;
+ }
+
+ list_remove(&packet->list_node);
if (flow->vlan_tci != subfacet->initial_tci) {
/* This packet was received on a VLAN splinter port. We added
* a VLAN to the packet to make the packet resemble the flow,