<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 May 2014 17:43, 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"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="">On 13 May 2014 16:44, Andy Zhou <span dir="ltr">&lt;<a href="mailto:azhou@nicira.com" target="_blank">azhou@nicira.com</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div><div>
&gt; diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c<br>
&gt; index 926f3d6..bb16e7b 100644<br>
&gt; --- a/ofproto/ofproto-dpif.c<br>
&gt; +++ b/ofproto/ofproto-dpif.c<br>
&gt; @@ -3211,10 +3211,11 @@ rule_dpif_lookup(struct ofproto_dpif *ofproto, struct flow *flow,<br>
&gt;      uint8_t table_id;<br>
&gt;<br>
&gt;      if (ofproto_dpif_get_enable_recirc(ofproto)) {<br>
&gt; -        /* Always exactly match recirc_id since datapath supports<br>
&gt; -         * recirculation.  */<br>
&gt; +        /* Always exactly match recirc_id and dp_hash since the datapath<br>
&gt; +         * supports recirculation.  */<br>
&gt;          if (wc) {<br>
&gt;              wc-&gt;masks.recirc_id = UINT32_MAX;<br>
&gt; +            wc-&gt;masks.dp_hash = UINT32_MAX;<br>
</div></div>How about MPLS use case that does not require dp_hash to be exactly matched?<br></blockquote><div><br></div></div><div>Hmm, I think I added that part in particular to handle differences when megaflows are disabled. Without that, the odp flow sent to the datapath includes the dp_hash with a mask of 0. Then, when the datapath dumps the flow, because the mask is 0, it doesn&#39;t dump it back.</div>


<div><br></div><div>Would it be better to always serialise the dp_hash in odp_flow_key_from_flow__(), or add a special case in dpif_netdev_flow_dump_next()?</div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">I&#39;m working on an alternative approach that would have the odp_flow_key_from_{flow,mask}() callers pass in a parameter to indicate whether it is the datapath or not. Based on this, it would pass a mask of features to odp_flow_key_from_flow__(), to decide what to serialise to odp. This should allow us to retain compatibility with older kernels but bring the userspace datapath more in line with that of the kernel. It&#39;s more-or-less a combination of the latter suggestion here and the existing patch.</div>

</div>