summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ofproto/ofproto-dpif-upcall.c15
-rw-r--r--tests/ofproto-dpif.at3
2 files changed, 18 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index d73dc1292..f76182e92 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -939,6 +939,21 @@ udpif_revalidator(void *arg)
latch_wait(&udpif->exit_latch);
latch_wait(&udpif->pause_latch);
poll_block();
+
+ if (!latch_is_set(&udpif->pause_latch) &&
+ !latch_is_set(&udpif->exit_latch)) {
+ long long int now = time_msec();
+ /* Block again if we are woken up within 5ms of the last start
+ * time. */
+ start_time += 5;
+
+ if (now < start_time) {
+ poll_timer_wait_until(start_time);
+ latch_wait(&udpif->exit_latch);
+ latch_wait(&udpif->pause_latch);
+ poll_block();
+ }
+ }
}
}
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index e2b983f69..025c92322 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -4609,6 +4609,9 @@ m4_define([CHECK_CONTINUATION], [dnl
m4_if([$3], [0], [],
[AT_CHECK([echo "$actions1" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br1 -])])
+ # Make sure the datapath is up-to-date before sending the packet.
+ ovs-appctl revalidator/wait
+
# Run a packet through the switch.
AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])