If a packet-in were to be queued, and the sequence number changed, after
grabbing the list of packet-ins, then the existing code could have gone to
sleep until something happened. By grabbing the sequence number before
the list of packet-ins, we avoid this race.
Found by inspection.
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs_rwlock_unlock(&ofproto->ml->rwlock);
}
ovs_rwlock_unlock(&ofproto->ml->rwlock);
}
+ /* Always updates the ofproto->pins_seqno to avoid frequent wakeup during
+ * flow restore. Even though nothing is processed during flow restore,
+ * all queued 'pins' will be handled immediately when flow restore
+ * completes. */
+ ofproto->pins_seqno = seq_read(ofproto->pins_seq);
+
/* Do not perform any periodic activity required by 'ofproto' while
* waiting for flow restore to complete. */
if (!ofproto_get_flow_restore_wait()) {
/* Do not perform any periodic activity required by 'ofproto' while
* waiting for flow restore to complete. */
if (!ofproto_get_flow_restore_wait()) {
- /* Always updates the ofproto->pins_seqno to avoid frequent wakeup during
- * flow restore. Even though nothing is processed during flow restore,
- * all queued 'pins' will be handled immediately when flow restore
- * completes. */
- ofproto->pins_seqno = seq_read(ofproto->pins_seq);
-
if (ofproto->netflow) {
netflow_run(ofproto->netflow);
}
if (ofproto->netflow) {
netflow_run(ofproto->netflow);
}