From: YAMAMOTO Takashi Date: Tue, 1 Apr 2014 12:21:45 +0000 (+0900) Subject: ofproto-dpif-upcall: Expire netflow flow when revalidate_ukey failed X-Git-Tag: v2.1.1~14 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=9b0008b516664d6e73cff907c1f6f0e077806c55 ofproto-dpif-upcall: Expire netflow flow when revalidate_ukey failed This fixes missing netflow flows in "ofproto-dpif - NetFlow flow expiration" tests. Acked-by: Joe Stringer Signed-off-by: YAMAMOTO Takashi Conflicts: ofproto/ofproto-dpif-upcall.c --- diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 641e3eac4..05ee0d21d 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1291,6 +1291,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; @@ -1304,6 +1305,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 @@ -1331,7 +1333,7 @@ revalidate_ukey(struct udpif *udpif, struct udpif_flow_dump *udump, } error = xlate_receive(udpif->backer, NULL, ukey->key, ukey->key_len, &flow, - NULL, &ofproto, NULL, NULL, NULL, &odp_in_port); + NULL, &ofproto, NULL, NULL, &netflow, &odp_in_port); if (error) { goto exit; } @@ -1380,6 +1382,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;