<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 16 May 2014 15:11, Andy Zhou <span dir="ltr">&lt;<a href="mailto:azhou@nicira.com" target="_blank">azhou@nicira.com</a>&gt;</span> wrote:<br><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 class="">On Wed, May 14, 2014 at 11:57 PM, Joe Stringer &lt;<a href="mailto:joestringer@nicira.com">joestringer@nicira.com</a>&gt; wrote:<br>
&gt; Signed-off-by: Joe Stringer &lt;<a href="mailto:joestringer@nicira.com">joestringer@nicira.com</a>&gt;<br>
&gt; ---<br>
&gt; v3: First post.<br>
&gt; ---<br>
&gt;  lib/odp-util.c |   41 +++++++++++++++++++++++++----------------<br>
&gt;  1 file changed, 25 insertions(+), 16 deletions(-)<br>
&gt;<br>
&gt; diff --git a/lib/odp-util.c b/lib/odp-util.c<br>
&gt; index 6cff2f1..ff3cb7e 100644<br>
&gt; --- a/lib/odp-util.c<br>
&gt; +++ b/lib/odp-util.c<br>
&gt; @@ -2482,16 +2482,16 @@ ovs_to_odp_frag_mask(uint8_t nw_frag_mask)<br>
&gt;<br>
&gt;  static void<br>
&gt;  odp_flow_key_from_flow__(struct ofpbuf *buf, const struct flow *flow,<br>
&gt; -                         const struct flow *mask, odp_port_t odp_in_port,<br>
&gt; -                         size_t max_mpls_depth, bool export_mask)<br>
&gt; +                         const struct flow *mask, const struct flow *data,<br>
&gt; +                         odp_port_t odp_in_port, size_t max_mpls_depth,<br>
&gt; +                         uint64_t export_mask)<br>
</div>Changing export_mask from bool to uint64_t seems to be overkill.  I<br>
hope we can avoid doing this.</blockquote><div><br></div><div>I realise I didn&#39;t explain how this should work, but it was an attempt at simplifying this code (if perhaps a little misguided). Rather than passing several parameters to determine special cases for the function, it would be nice to be able to specify separately what to serialise and what to not. </div>

<div><br></div><div><br></div><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">
How about we the following prototype:<br>
<div class="">odp_flow_key_from_flow__(struct ofpbuf *buf, const struct flow *flow,<br>
</div><div class="">                         const struct flow *mask, odp_port_t odp_in_port,<br>
</div>                         size_t max_mpls_depth, bool dp_recirc, bool<br>
export_mask)<br>
---------------------------------------------------------&gt;  ^^^^^^^^^^^^^^^<br>
<br>
/* dp_recirc indicates that datapath understands recirculation */<br>
<br>
The decision of exporting recirc_id and dp_hash will be simple:<br>
<br>
     if (dp_recric) {<br>
           nl_msg_put_u32(buf, OVS_KEY_ATTR_RECIRC_ID ...)<br>
           nl_msg_put_u32(buf, OVS_KEY_ATTR_DP_HASH ... )<br>
     }<br>
<br>
We can obtain dp_recirc value similar to max_mpls_depth.<br>
<br>
For example: in ofproto-dpif-upcall.c  we can call<br>
ofproto_dpif_get_enable_recirc() to obtain the value.<br>
<br>
dp_recirc can always be set to true within the user space datapath.<br>
<br>
Would this work?</blockquote><div><br></div><div>I think this would work. We already store the value for dp_recirc, which can be retrieved by ofproto_dpif_get_enable_recirc(). If you&#39;re happy with that, I can resend.</div>

</div></div></div>