<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 May 2014 17:43, Joe Stringer <span dir="ltr"><<a href="mailto:joestringer@nicira.com" target="_blank">joestringer@nicira.com</a>></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"><<a href="mailto:azhou@nicira.com" target="_blank">azhou@nicira.com</a>></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>
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c<br>
> index 926f3d6..bb16e7b 100644<br>
> --- a/ofproto/ofproto-dpif.c<br>
> +++ b/ofproto/ofproto-dpif.c<br>
> @@ -3211,10 +3211,11 @@ rule_dpif_lookup(struct ofproto_dpif *ofproto, struct flow *flow,<br>
> uint8_t table_id;<br>
><br>
> if (ofproto_dpif_get_enable_recirc(ofproto)) {<br>
> - /* Always exactly match recirc_id since datapath supports<br>
> - * recirculation. */<br>
> + /* Always exactly match recirc_id and dp_hash since the datapath<br>
> + * supports recirculation. */<br>
> if (wc) {<br>
> wc->masks.recirc_id = UINT32_MAX;<br>
> + wc->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'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'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's more-or-less a combination of the latter suggestion here and the existing patch.</div>
</div>