[ovs-dev] [PATCH v2] datapath-windows: Prevent ct-counters from getting redundantly incremented

Alin Gabriel Serdean aserdean at ovn.org
Fri Apr 27 17:03:43 UTC 2018


> On 27 Apr 2018, at 20:00, Anand Kumar <kumaranand at vmware.com> wrote:
> 
> 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 at vmware.com>
> ---
> datapath-windows/ovsext/Conntrack.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
> index 678bedb..add1491 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);
>     }
> 
> -- 
> 2.9.3.windows.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev <https://mail.openvswitch.org/mailman/listinfo/ovs-dev>

Acked-by: Alin Gabriel Serdean <aserdean at ovn.org <mailto:aserdean at ovn.org>>



More information about the dev mailing list