<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 24, 2013 at 1:58 PM, Ben Pfaff <span dir="ltr">&lt;<a href="mailto:blp@nicira.com" target="_blank">blp@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 class="im">experimenter IDs<br>
&gt; &gt; by adding new *_VENDOR_ID definitions to openflow-common.h.<br>
&gt; &gt;<br>
&gt; &gt; Signed-off-by: Ben Pfaff &lt;<a href="mailto:blp@nicira.com">blp@nicira.com</a>&gt;<br>
<br>
</div>Please snip more when you add inline comments, so that I don&#39;t<br>
accidentally miss some of your questions among the quoted text.<br>
Thanks.</blockquote><div><br></div><div style>Sorry, will starting doing it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">&gt; &gt; +                if enum in reverse[version]:<br>

&gt; &gt; +                    error(&quot;%s: %s in OF%s means both %#x,%d,%d and &quot;<br>
&gt; &gt; +                          &quot;%#x,%d,%d.&quot; %<br>
&gt; &gt; +                          (dst, enum, version_reverse_map[version],<br>
&gt; &gt; +                           reverse[version][enum][0],<br>
&gt; &gt; +                           reverse[version][enum][1],<br>
&gt; &gt; +                           reverse[version][enum][2],<br>
&gt; &gt; +                           vendor, type_, code))<br>
&gt; &gt; +                reverse[version][enum] = (vendor, type_, code)<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Want to ask here, I&#39;m not sure whether &quot;if enum in reverse[version]&quot; will<br>
&gt; ever be true. Because, if it is true, that means there are two exactly same<br>
&gt; enum strings, which is impossible. The compiler will complain if two<br>
&gt; entries in the enumeration have same name.<br>
<br>
</div>I think you&#39;re right.<br>
<br>
Here&#39;s an incremental improvement, then:<br></blockquote><div><br></div><div><br></div><div style>Thanks, I&#39;ll check the new patch.</div><div style> </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">&gt; &gt;      OFPERR_OFPRRFC_BAD_ROLE,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; For NX, &quot;(1,513)&quot;, do the type and code here correspond to &quot;struct<br>
&gt; nx_vendor_error &#39;s type and code&quot;?<br>
<br>
</div>Yes.<br>
<div class="im"><br>
&gt; What is the rule of defining NX code here?<br>
<br>
</div>The &quot;role&quot; feature is a Nicira extension to OpenFlow that was adopted<br>
in OpenFlow 1.2 as a standard feature, so OpenFlow 1.2 and later have<br>
standard error codes for the feature.<br>
<div class="im"><br>
&gt; Also, seems to me that now, the legit vendors (with assigned vendor id) can<br>
&gt; freely define their own error messages, right?<br>
<br>
</div>Yes, and in fact if you add another vendor ID to<br>
include/openflow/openflow-common.h then you can also add corresponding<br>
error codes in lib/ofp-errors.h.<br>
<div class="im"><span style="color:rgb(34,34,34)"></span></div></blockquote><div><br></div><div><br></div><div style>Thanks, the explanation makes sense.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><span style="color:rgb(34,34,34)"> </span><br></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
&gt; &gt;  dnl Write-Metadata duplicated.<br>
&gt; &gt; -# bad OF1.1 instructions: OFPBAC_UNSUPPORTED_ORDER<br>
&gt; &gt; +# bad OF1.1 instructions: NXBIC_DUP_INSTRUCTION<br>
&gt; &gt;  0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 0002 0018 00000000<br>
&gt; &gt; fedcba9876543210 ff00ff00ff00ff00<br>
&gt;<br>
&gt;<br>
&gt; Want to ask what does NXBIC stand for? Also, I didn&#39;t find the definition<br>
&gt; of this macro, even before applying patch 5/5. Want to know how and where<br>
&gt; is it defined?<br>
<br>
</div>Oops.  This is a mistake.  This change should not be in this patch.<br>
I&#39;ve removed it.</blockquote><div><br></div><div><br></div><div style>I&#39;m still curious why the test still passes. Could you explain more? Thanks</div><div style><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">&gt; followed the code<br>
&gt; and decoded it myself. And I really want to ask an unrelated question.<br>
&gt;<br>
&gt; I saw in the &quot;ofperr_encode_msg__()&quot; function in &quot;lib/ofp-error.c&quot;, the<br>
&gt; fields are converted to<br>
&gt; network order, like below:<br>
&gt;<br>
&gt; &quot;<br>
&gt;         oem = ofpbuf_put_uninit(buf, sizeof *oem);<br>
&gt;         oem-&gt;type = htons(NXET_VENDOR);<br>
&gt; &quot;<br>
&gt;<br>
&gt; In the &quot;ovs_hex_dump()&quot; function which prints the encoded header, it uses<br>
&gt; &quot;fprintf(stream, &quot;%02hhx&quot;<br>
&gt; to print it and the value is again in host order (if %x is used, it will<br>
&gt; print the network order).<br>
&gt;<br>
&gt; So I want to ask what is the use of &quot;hhx&quot; here? and why can&#39;t we get rid of<br>
&gt; htons and use %x in<br>
&gt; ovs_hex_dump?<br>
<br>
</div></div>&#39;oem&#39; is a &quot;wire format&quot; type, and its member &#39;type&#39; is an ovs_be16,<br>
so to appropriately assign it a value it must be converted to network<br>
byte order first.  That is why htons() is used.<br>
<br>
ovs_hex_dump() dumps the contents of a structure byte by byte.  Its<br>
output will depend on the byte order of the underlying data.  In this<br>
case the data is in network byte order, so the byte-by-byte dump will<br>
reflect that.<br>
<br>
&#39;hh&#39; doesn&#39;t have anything to do with byte order.  It means that the<br>
argument is a char type.<br></blockquote><div> </div><div><br></div><div style>Thanks for the explanation. My previous experiment was wrong. And I found out that the if &quot;htons&quot; is not used the &quot;0xb0c2&quot; when converted to &quot;uint8 buf[2]&quot; will be &quot;buf[0]=0xc2&quot; and &quot;buf[1]=0xb0&quot;. So I think the &quot;htons&quot; also helps preserve the hex order. right?</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;ll repost this series since it has changed a bit.<br>
</blockquote></div><br></div></div>