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: sliver-openvswitch-2.2.90-1~5^2~35 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=42f3bacaf146f3c4fc5990f038c545ec3b70daa5 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 --- diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index de72a227b..938cfdebc 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;