]> git.proxmox.com Git - ovs.git/commitdiff
connmgr: Fix violation of flow monitoring protocol description.
authorBen Pfaff <blp@ovn.org>
Thu, 28 Sep 2017 16:27:25 +0000 (09:27 -0700)
committerBen Pfaff <blp@ovn.org>
Thu, 28 Sep 2017 21:43:20 +0000 (14:43 -0700)
nicira-ext.h says:

 * 1. OVS sends an NXT_FLOW_MONITOR_PAUSED message to the controller, following
 *    all the already queued notifications.  After it receives this message,
 *    the controller knows that its view of the flow table, as represented by
 *    flow monitor notifications, is incomplete.

The actual implementation could send NXT_FLOW_MONITOR_PAUSED in the middle
of a series of queued notifications.  This fixes it to always send it after
those notifications.  Possibly this confused some controllers, since the
documentation said that NXFME_ADD and NXFME_MODIFIED notifications wouldn't
be sent between "pause" and "resume" messages, but this bug could cause
them to be sent just after "pause".

VMware-BZ: #1919454
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
ofproto/connmgr.c

index c0ce828ce00a952e6ca49929ae42dc9b514fb281..30c627f43d9f3c2f8e5d6c60b8e3ae05125f202f 100644 (file)
@@ -2237,22 +2237,22 @@ ofmonitor_flush(struct connmgr *mgr)
     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);
         }
     }
 }