<div dir="ltr"><div class="gmail_default" style="font-size:small">You should don't comment a asserts, but introduce an additional connect flag to handle used fields if this flag set.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As i see you have write an code to work between patched nodes, but we have no guaratee all nodes in clusters uses same version all time.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 21, 2017 at 10:43 PM, Yan Li <span dir="ltr"><<a href="mailto:yanli@ascar.io" target="_blank">yanli@ascar.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Modified the request message to embed sent_time, which will be<br>
returned from the server and used to calculate the exponentially<br>
weighted moving average of sent_time gap in return messages. It is<br>
used as a metric for rate-limiting quality of service.<br>
<br>
Signed-off-by: Yan Li <<a href="mailto:yanli@ascar.io">yanli@ascar.io</a>><br>
---<br>
 lustre/include/lustre/lustre_<wbr>idl.h | 4 ++++<br>
 lustre/ptlrpc/pack_generic.c       | 5 +++++<br>
 lustre/ptlrpc/wiretest.c           | 2 ++<br>
 lustre/utils/wiretest.c            | 2 ++<br>
 4 files changed, 13 insertions(+)<br>
<br>
diff --git a/lustre/include/lustre/<wbr>lustre_idl.h b/lustre/include/lustre/<wbr>lustre_idl.h<br>
index bf23a47..7a200d1 100644<br>
--- a/lustre/include/lustre/<wbr>lustre_idl.h<br>
+++ b/lustre/include/lustre/<wbr>lustre_idl.h<br>
@@ -3336,8 +3336,12 @@ struct obdo {<br>
                                                 * each stripe.<br>
                                                 * brw: grant space consumed on<br>
                                                 * the client for the write */<br>
+#ifdef ENABLE_RLQOS<br>
+       struct timeval          o_sent_time;    /* timeval is 64x2 bits on Linux */<br>
+#else<br>
        __u64                   o_padding_4;<br>
        __u64                   o_padding_5;<br>
+#endif<br>
        __u64                   o_padding_6;<br>
 };<br>
<br>
diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c<br>
index 8df8ea8..d0bc87a 100644<br>
--- a/lustre/ptlrpc/pack_generic.c<br>
+++ b/lustre/ptlrpc/pack_generic.c<br>
@@ -1722,8 +1722,13 @@ void lustre_swab_obdo (struct obdo  *o)<br>
         __swab32s (&o->o_uid_h);<br>
         __swab32s (&o->o_gid_h);<br>
         __swab64s (&o->o_data_version);<br>
+#ifdef ENABLE_RLQOS<br>
+        __swab64s ((__u64*)&o->o_sent_time.tv_<wbr>sec);<br>
+        __swab64s ((__u64*)&o->o_sent_time.tv_<wbr>usec);<br>
+#else<br>
         CLASSERT(offsetof(typeof(*o), o_padding_4) != 0);<br>
         CLASSERT(offsetof(typeof(*o), o_padding_5) != 0);<br>
+#endif<br>
         CLASSERT(offsetof(typeof(*o), o_padding_6) != 0);<br>
<br>
 }<br>
diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c<br>
index 070ef91..0c909a6 100644<br>
--- a/lustre/ptlrpc/wiretest.c<br>
+++ b/lustre/ptlrpc/wiretest.c<br>
@@ -1314,6 +1314,7 @@ void lustre_assert_wire_constants(<wbr>void)<br>
                 (long long)(int)offsetof(struct obdo, o_data_version));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n",<br>
                 (long long)(int)sizeof(((struct obdo *)0)->o_data_version));<br>
+#ifndef ENABLE_RLQOS<br>
        LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",<br>
                 (long long)(int)offsetof(struct obdo, o_padding_4));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 8, "found %lld\n",<br>
@@ -1322,6 +1323,7 @@ void lustre_assert_wire_constants(<wbr>void)<br>
                 (long long)(int)offsetof(struct obdo, o_padding_5));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_5) == 8, "found %lld\n",<br>
                 (long long)(int)sizeof(((struct obdo *)0)->o_padding_5));<br>
+#endif<br>
        LASSERTF((int)offsetof(struct obdo, o_padding_6) == 200, "found %lld\n",<br>
                 (long long)(int)offsetof(struct obdo, o_padding_6));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_6) == 8, "found %lld\n",<br>
diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c<br>
index 233d7d8..47fbbf0 100644<br>
--- a/lustre/utils/wiretest.c<br>
+++ b/lustre/utils/wiretest.c<br>
@@ -1329,6 +1329,7 @@ void lustre_assert_wire_constants(<wbr>void)<br>
                 (long long)(int)offsetof(struct obdo, o_data_version));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n",<br>
                 (long long)(int)sizeof(((struct obdo *)0)->o_data_version));<br>
+#ifndef ENABLE_RLQOS<br>
        LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",<br>
                 (long long)(int)offsetof(struct obdo, o_padding_4));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 8, "found %lld\n",<br>
@@ -1337,6 +1338,7 @@ void lustre_assert_wire_constants(<wbr>void)<br>
                 (long long)(int)offsetof(struct obdo, o_padding_5));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_5) == 8, "found %lld\n",<br>
                 (long long)(int)sizeof(((struct obdo *)0)->o_padding_5));<br>
+#endif<br>
        LASSERTF((int)offsetof(struct obdo, o_padding_6) == 200, "found %lld\n",<br>
                 (long long)(int)offsetof(struct obdo, o_padding_6));<br>
        LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_6) == 8, "found %lld\n",<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
______________________________<wbr>_________________<br>
lustre-devel mailing list<br>
<a href="mailto:lustre-devel@lists.lustre.org">lustre-devel@lists.lustre.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.lustre.org_listinfo.cgi_lustre-2Ddevel-2Dlustre.org&d=DwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=m8P9AM2wTf4l79yg9e1LHD5IHagtwa3P4AXaemlM6Lg&m=NuClc8LkPaQ91Zav0h5yoiRmBVC4_Ks9Db6KX3xsRmk&s=6FVNfemWTMvnOwmVBxixoJyS4CNIP_D14UGw2pWlGd0&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=http-3A__lists.<wbr>lustre.org_listinfo.cgi_<wbr>lustre-2Ddevel-2Dlustre.org&d=<wbr>DwICAg&c=IGDlg0lD0b-<wbr>nebmJJ0Kp8A&r=<wbr>m8P9AM2wTf4l79yg9e1LHD5IHagtwa<wbr>3P4AXaemlM6Lg&m=<wbr>NuClc8LkPaQ91Zav0h5yoiRmBVC4_<wbr>Ks9Db6KX3xsRmk&s=<wbr>6FVNfemWTMvnOwmVBxixoJyS4CNIP_<wbr>D14UGw2pWlGd0&e=</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Alexey Lyashkov <strong>·</strong> Technical lead for a Morpheus team<br>
Seagate Technology, LLC<br>
<a href="http://www.seagate.com" target="_blank">www.seagate.com</a><br><div><a href="http://www.lustre.org" target="_blank">www.lustre.org</a></div></div></div>
</div>