<div dir="ltr">Based on the discussion offline,  we should not set the<div><br></div><div>&quot;<span style="font-family:arial,sans-serif;font-size:12.800000190734863px">+            ukey-&gt;xcache = NULL;</span>&quot;</div>

<div><br></div><div>And this change deserves further discussion~.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 8:45 PM, Joe Stringer <span dir="ltr">&lt;<a href="mailto:joestringer@nicira.com" target="_blank">joestringer@nicira.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One of the reasons that xlate_cache was introduced was to ensure that<br>
statistics were attributed to the correct rules and interfaces according<br>
to the flow that was installed into the datapath, rather than according<br>
to the current state of the flow table.<br>
<br>
This patch makes the revalidators use the xlate_cache to attribute stats<br>
when full revalidation is required.<br>
<br>
Signed-off-by: Joe Stringer &lt;<a href="mailto:joestringer@nicira.com">joestringer@nicira.com</a>&gt;<br>
---<br>
 ofproto/ofproto-dpif-upcall.c |   16 ++++++++++------<br>
 1 file changed, 10 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c<br>
index 3e8dda5..7dae150 100644<br>
--- a/ofproto/ofproto-dpif-upcall.c<br>
+++ b/ofproto/ofproto-dpif-upcall.c<br>
@@ -1256,10 +1256,17 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey,<br>
     }<br>
<br>
     may_learn = push.n_packets &gt; 0;<br>
-    if (ukey-&gt;xcache &amp;&amp; !udpif-&gt;need_revalidate) {<br>
+    if (ukey-&gt;xcache) {<br>
         xlate_push_stats(ukey-&gt;xcache, may_learn, &amp;push);<br>
-        ok = true;<br>
-        goto exit;<br>
+        if (udpif-&gt;need_revalidate) {<br>
+            xlate_cache_clear(ukey-&gt;xcache);<br>
+            ukey-&gt;xcache = NULL;<br>
+            push.n_packets = 0;<br>
+            push.n_bytes = 0;<br>
+        } else {<br>
+            ok = true;<br>
+            goto exit;<br>
+        }<br>
     }<br>
<br>
     error = xlate_receive(udpif-&gt;backer, NULL, ukey-&gt;key, ukey-&gt;key_len, &amp;flow,<br>
@@ -1268,9 +1275,6 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey,<br>
         goto exit;<br>
     }<br>
<br>
-    if (udpif-&gt;need_revalidate) {<br>
-        xlate_cache_clear(ukey-&gt;xcache);<br>
-    }<br>
     if (!ukey-&gt;xcache) {<br>
         ukey-&gt;xcache = xlate_cache_new();<br>
     }<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@openvswitch.org">dev@openvswitch.org</a><br>
<a href="http://openvswitch.org/mailman/listinfo/dev" target="_blank">http://openvswitch.org/mailman/listinfo/dev</a><br>
</font></span></blockquote></div><br></div>