[ovs-dev] [PATCH] ofproto-dpif-upcall: Expire netflow flow when revalidate_ukey failed

Joe Stringer joestringer at nicira.com
Wed Apr 2 21:16:55 UTC 2014


I had noticed that this logic was in the codepath for when we delete a flow
from the datapath, but not in this codepath. Thanks for picking this up!

Acked-by: Joe Stringer <joestringer at nicira.com>


On 2 April 2014 17:18, YAMAMOTO Takashi <yamamoto at valinux.co.jp> wrote:

> This fixes missing netflow flows in
> "ofproto-dpif - NetFlow flow expiration" tests.
>
> Signed-off-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
> ---
>  ofproto/ofproto-dpif-upcall.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
> index 5b5fb6e..8639f5c 100644
> --- a/ofproto/ofproto-dpif-upcall.c
> +++ b/ofproto/ofproto-dpif-upcall.c
> @@ -1332,6 +1332,7 @@ revalidate_ukey(struct udpif *udpif, struct
> udpif_flow_dump *udump,
>      struct ofpbuf xout_actions, *actions;
>      uint64_t slow_path_buf[128 / 8];
>      struct xlate_out xout, *xoutp;
> +    struct netflow *netflow;
>      struct flow flow, udump_mask;
>      struct ofproto_dpif *ofproto;
>      struct dpif_flow_stats push;
> @@ -1345,6 +1346,7 @@ revalidate_ukey(struct udpif *udpif, struct
> udpif_flow_dump *udump,
>      ok = false;
>      xoutp = NULL;
>      actions = NULL;
> +    netflow = NULL;
>
>      /* If we don't need to revalidate, we can simply push the stats
> contained
>       * in the udump, otherwise we'll have to get the actions so we can
> check
> @@ -1372,7 +1374,7 @@ revalidate_ukey(struct udpif *udpif, struct
> udpif_flow_dump *udump,
>      }
>
>      error = xlate_receive(udpif->backer, NULL, ukey->key, ukey->key_len,
> &flow,
> -                          &ofproto, NULL, NULL, NULL, &odp_in_port);
> +                          &ofproto, NULL, NULL, &netflow, &odp_in_port);
>      if (error) {
>          goto exit;
>      }
> @@ -1421,6 +1423,13 @@ revalidate_ukey(struct udpif *udpif, struct
> udpif_flow_dump *udump,
>      ok = true;
>
>  exit:
> +    if (netflow) {
> +        if (!ok) {
> +            netflow_expire(netflow, &flow);
> +            netflow_flow_clear(netflow, &flow);
> +        }
> +        netflow_unref(netflow);
> +    }
>      ofpbuf_delete(actions);
>      xlate_out_uninit(xoutp);
>      return ok;
> --
> 1.8.3.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140403/827f6622/attachment-0005.html>


More information about the dev mailing list