summaryrefslogtreecommitdiff
path: root/lib/dpif-netdev.c
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2015-05-20 16:55:17 -0700
committerEthan Jackson <ethan@nicira.com>2015-05-21 13:49:46 -0700
commit603f2ce04d000892cc4db841cff7b3b3fc95bb6c (patch)
treed2bd3b4a3034607ff573a025e22f5031acc99d7e /lib/dpif-netdev.c
parent9154f798ef0011ea9d1d7fb1dc91b51b60da82d3 (diff)
downloadopenvswitch-603f2ce04d000892cc4db841cff7b3b3fc95bb6c.tar.gz
dpif-netdev: Clear flow batches before execute.
When executing actions, it's possible a recirculation will occur causing dp_netdev_input() to be called multiple times. If the batch pointers embedded in dp_netdev_flow aren't cleared, it's possible packets after the recirculation will be reinserted into a batch associated with the original lookup. This could be very bad. This patch fixes the problem by zeroing out flow batch pointers before calling packet_batch_execute(). This probably has a slightly negative performance impact, though I haven't tried it. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Diffstat (limited to 'lib/dpif-netdev.c')
-rw-r--r--lib/dpif-netdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index b4a42eb11..ff583e7b1 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3066,7 +3066,6 @@ packet_batch_execute(struct packet_batch *batch,
struct dp_netdev_actions *actions;
struct dp_netdev_flow *flow = batch->flow;
- flow->batch = NULL;
dp_netdev_flow_used(flow, batch->packet_count, batch->byte_count,
batch->tcp_flags, now);
@@ -3299,6 +3298,10 @@ dp_netdev_input(struct dp_netdev_pmd_thread *pmd,
}
for (i = 0; i < n_batches; i++) {
+ batches[i].flow->batch = NULL;
+ }
+
+ for (i = 0; i < n_batches; i++) {
packet_batch_execute(&batches[i], pmd, now);
}
}