<div dir="ltr">Hi guys,<div><br></div><div>Great job Numan!</div><div>As we discussed over IRC, the patch below may make more sense.</div><div>It essentially sets the dl_type so that when packet comes from the controller, it matches</div><div>a valid type and <span style="font-size:12.8px">OVS_KEY_ATTR_CT_ORIG_TUPLE_</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">IPV4 is not added.</span></div><div>Maybe what Numan proposed and this patch could be a good combination but I think</div><div>that we definitely need to set the dl_type as it&#39;s later checked in <span style="font-size:12.8px">pkt_metadata_from_flow()</span></div><div><span style="font-size:12.8px">and it&#39;ll be zero there otherwise.</span></div><div><span style="font-size:12.8px">What do you guys think? I have tried the patch below and the kernel error is not shown</span></div><div><span style="font-size:12.8px">anymore when issuing DHCP requests.</span></div><div><br></div><div><br></div><div><div>diff --git a/lib/flow.c b/lib/flow.c</div><div>index b2b10aa..62b948f 100644</div><div>--- a/lib/flow.c</div><div>+++ b/lib/flow.c</div><div>@@ -1073,6 +1073,7 @@ flow_get_metadata(const struct flow *flow, struct match *flow_metadata)</div><div> </div><div>     if (flow-&gt;ct_state != 0) {</div><div>         match_set_ct_state(flow_metadata, flow-&gt;ct_state);</div><div>+        match_set_dl_type(flow_metadata, flow-&gt;dl_type);</div><div>         if (is_ct_valid(flow, NULL, NULL) &amp;&amp; flow-&gt;ct_nw_proto != 0) {</div><div>             if (flow-&gt;dl_type == htons(ETH_TYPE_IP)) {</div><div>                 match_set_ct_nw_src(flow_metadata, flow-&gt;ct_nw_src);</div></div><div><br></div><div><br></div><div>Thanks,</div><div>Daniel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 24, 2017 at 10:38 PM, Ben Pfaff <span dir="ltr">&lt;<a href="mailto:blp@ovn.org" target="_blank">blp@ovn.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Oct 24, 2017 at 09:04:22PM +0530, Numan Siddique wrote:<br>
&gt; We did some more investigation. This issue is seen only when OVN  native<br>
&gt; dhcp is used and with kernel datapath which doesn&#39;t support<br>
&gt; OVS_KEY_ATTR_CT_ORIG_TUPLE_<wbr>IPV4.  The reason for this failure is because<br>
&gt; ovs-vswitchd includes the attribute OVS_KEY_ATTR_CT_ORIG_TUPLE_<wbr>IPV4 when it<br>
&gt; sends the packet back to the datapath after the dhcp reply packet is<br>
&gt; resumed.<br>
&gt;<br>
&gt; When the dhcp packet is sent to ovn-controller, the ct_state value is set<br>
&gt; to 0x21 and dl_type is set to 0 in the flow metadata. When the packet is<br>
&gt; resumed, the function nxt_resume() calls &#39;pkt_metadata_from_flow()&#39; which<br>
&gt; neither sets &#39;md-&gt;ct_orig_tuple&#39; or memsets it [1] because is_ct_valid()<br>
&gt; returns true and dl_type is 0. And the function odp_key_from_dp_packet()<br>
&gt; adds OVS_KEY_ATTR_CT_ORIG_TUPLE_<wbr>IPV4 [2]<br>
&gt;<br>
&gt; This issue is not seen in master because of this commit - &quot;f6fabcc624<br>
&gt; ofproto-dpif: Mark packets as &quot;untracked&quot; after call to ct()&quot; [3]<br>
&gt;<br>
&gt; This patch clears the conn track variables after the ct() action.<br>
&gt;<br>
&gt; I suppose we cannot apply this patch to OVS 2.8 branch because it was<br>
&gt; reverted [4] due to some issues.<br>
&gt;<br>
&gt; I think we can solve this problem either with the below fixe or by setting<br>
&gt; dl_type to proper value when the packet is sent to controller.<br>
&gt;<br>
&gt; ******************************<wbr>*****<br>
&gt; diff --git a/lib/flow.h b/lib/flow.h<br>
&gt; index 6ae5a674d..076ce36f1 100644<br>
&gt; --- a/lib/flow.h<br>
&gt; +++ b/lib/flow.h<br>
&gt; @@ -947,6 +947,8 @@ pkt_metadata_from_flow(struct pkt_metadata *md, const<br>
&gt; struct flow *flow)<br>
&gt;                  flow-&gt;ct_tp_dst,<br>
&gt;                  flow-&gt;ct_nw_proto,<br>
&gt;              };<br>
&gt; +        } else {<br>
&gt; +            memset(&amp;md-&gt;ct_orig_tuple, 0, sizeof md-&gt;ct_orig_tuple);<br>
&gt;          }<br>
&gt;      } else {<br>
&gt;          memset(&amp;md-&gt;ct_orig_tuple, 0, sizeof md-&gt;ct_orig_tuple);<br>
&gt; ******************************<wbr>****<br>
&gt;<br>
&gt; Please let me know if this fix makes sense ? Or if there is a better way to<br>
&gt; solve it ?<br>
<br>
</div></div>I think that is a reasonable patch.  Will you please propose it as a<br>
formal patch?  Please include a thorough commit message.<br>
</blockquote></div><br></div>