diff options
author | Anand Kumar <kumaranand@vmware.com> | 2018-04-27 10:00:30 -0700 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2018-04-30 23:28:54 +0300 |
commit | e5e22dcf8168f0b791b5d922ecc9501ddd5c0039 (patch) | |
tree | 16a0e966a68cebf13694e5e2c8e94fff809675d6 /datapath-windows | |
parent | 6bb97140b3a9caa4e90d3f5081ffaca9f6ae9d1b (diff) | |
download | openvswitch-e5e22dcf8168f0b791b5d922ecc9501ddd5c0039.tar.gz |
datapath-windows: Prevent ct-counters from getting redundantly incremented
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>
Diffstat (limited to 'datapath-windows')
-rw-r--r-- | datapath-windows/ovsext/Conntrack.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c index 678bedb65..add1491ed 100644 --- a/datapath-windows/ovsext/Conntrack.c +++ b/datapath-windows/ovsext/Conntrack.c @@ -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); } |