struct ofconn *ofconn;
LIST_FOR_EACH (ofconn, node, &mgr->all_conns) {
- struct ofpbuf *msg;
+ struct rconn_packet_counter *counter = ofconn->monitor_counter;
+ struct ofpbuf *msg;
LIST_FOR_EACH_POP (msg, list_node, &ofconn->updates) {
- unsigned int n_bytes;
-
- ofconn_send(ofconn, msg, ofconn->monitor_counter);
- n_bytes = rconn_packet_counter_n_bytes(ofconn->monitor_counter);
- if (!ofconn->monitor_paused && n_bytes > 128 * 1024) {
- struct ofpbuf *pause;
-
- COVERAGE_INC(ofmonitor_pause);
- ofconn->monitor_paused = monitor_seqno++;
- pause = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_MONITOR_PAUSED,
- OFP10_VERSION, htonl(0), 0);
- ofconn_send(ofconn, pause, ofconn->monitor_counter);
- }
+ ofconn_send(ofconn, msg, counter);
+ }
+
+ if (!ofconn->monitor_paused
+ && rconn_packet_counter_n_bytes(counter) > 128 * 1024) {
+ struct ofpbuf *pause;
+
+ COVERAGE_INC(ofmonitor_pause);
+ ofconn->monitor_paused = monitor_seqno++;
+ pause = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_MONITOR_PAUSED,
+ OFP10_VERSION, htonl(0), 0);
+ ofconn_send(ofconn, pause, counter);
}
}
}