]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath-windows: Prevent ct-counters from getting redundantly incremented
authorAnand Kumar <kumaranand@vmware.com>
Fri, 27 Apr 2018 17:00:30 +0000 (10:00 -0700)
committerAlin Gabriel Serdean <aserdean@ovn.org>
Mon, 30 Apr 2018 20:28:54 +0000 (23:28 +0300)
The conntrack-counters ought to be incremented only if it's a new lookup
or if it's recirculated through a different zone for the first time.

Signed-off-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
datapath-windows/ovsext/Conntrack.c

index 678bedb65d20877c25600c134144f50b933c4b67..add1491ed29b2070717b94d85eea05796d398911 100644 (file)
@@ -886,10 +886,11 @@ OvsCtExecute_(OvsForwardingContext *fwdCtx,
         return NDIS_STATUS_RESOURCES;
     }
 
-    /* Increment the counters soon after the lookup, since we set ct.state
-     * to OVS_CS_F_TRACKED after processing the ct entry.
+    /* Increment stats for the entry if it wasn't tracked previously or
+     * if they are on different zones
      */
-    if (entry && (!(key->ct.state & OVS_CS_F_TRACKED))) {
+    if (entry && (entry->key.zone != key->ct.zone ||
+           (!(key->ct.state & OVS_CS_F_TRACKED)))) {
         OvsCtIncrementCounters(entry, ctx.reply, curNbl);
     }