On 21 March 2017 at 00:02, Sairam Venugopal <vsai...@vmware.com> wrote:

> Add support for handling OVS_CT_ATTR_FORCE_COMMIT in Conntrack action.
> When this flag is specified, it implicitly means commit and deletes
> entries in the reverse direction.
>
> Signed-off-by: Sairam Venugopal <vsai...@vmware.com>
>

Applied to master.


> ---
>  datapath-windows/ovsext/Conntrack.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/datapath-windows/ovsext/Conntrack.c
> b/datapath-windows/ovsext/Conntrack.c
> index 9f41861..35ab7a1 100644
> --- a/datapath-windows/ovsext/Conntrack.c
> +++ b/datapath-windows/ovsext/Conntrack.c
> @@ -633,6 +633,7 @@ OvsCtExecute_(PNET_BUFFER_LIST curNbl,
>                OvsFlowKey *key,
>                OVS_PACKET_HDR_INFO *layers,
>                BOOLEAN commit,
> +              BOOLEAN force,
>                UINT16 zone,
>                MD_MARK *mark,
>                MD_LABELS *labels,
> @@ -653,6 +654,13 @@ OvsCtExecute_(PNET_BUFFER_LIST curNbl,
>      /* Lookup Conntrack entries for a matching entry */
>      entry = OvsCtLookup(&ctx);
>      BOOLEAN entryCreated = FALSE;
> +
> +    /* Delete entry in reverse direction if 'force' is specified */
> +    if (entry && force && ctx.reply) {
> +        OvsCtEntryDelete(entry);
> +        entry = NULL;
> +    }
> +
>      if (!entry) {
>          /* If no matching entry was found, create one and add New state */
>          entry = OvsCtEntryCreate(curNbl, key->ipKey.nwProto,
> @@ -709,6 +717,7 @@ OvsExecuteConntrackAction(PNET_BUFFER_LIST curNbl,
>  {
>      PNL_ATTR ctAttr;
>      BOOLEAN commit = FALSE;
> +    BOOLEAN force = FALSE;
>      UINT16 zone = 0;
>      MD_MARK *mark = NULL;
>      MD_LABELS *labels = NULL;
> @@ -721,6 +730,7 @@ OvsExecuteConntrackAction(PNET_BUFFER_LIST curNbl,
>          return status;
>      }
>
> +    /* XXX Convert this to NL_ATTR_FOR_EACH */
>      ctAttr = NlAttrFindNested(a, OVS_CT_ATTR_ZONE);
>      if (ctAttr) {
>          zone = NlAttrGetU16(ctAttr);
> @@ -748,9 +758,15 @@ OvsExecuteConntrackAction(PNET_BUFFER_LIST curNbl,
>              return NDIS_STATUS_NOT_SUPPORTED;
>          }
>      }
> +    ctAttr = NlAttrFindNested(a, OVS_CT_ATTR_FORCE_COMMIT);
> +    if (ctAttr) {
> +        force = TRUE;
> +        /* Force implicitly means commit */
> +        commit = TRUE;
> +    }
>
> -    status = OvsCtExecute_(curNbl, key, layers,
> -                           commit, zone, mark, labels, helper);
> +    status = OvsCtExecute_(curNbl, key, layers, commit, force,
> +                           zone, mark, labels, helper);
>      return status;
>  }
>
> --
> 2.9.0.windows.1
>
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to