<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hello,justin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Forgive me!&nbsp; I have another question. As OVN use meters to implement&nbsp; QoS and meters was added from ovs2.10, how the ovn(&lt;2.10) support QoS?</div><br><br><br><div>Regards,</div><div>Yunxiang</div><div style="position:relative;zoom:1"></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2019-01-28 15:43:24, "Justin Pettit" &lt;jpettit@ovn.org&gt; wrote:
&gt;Sorry, I was thinking of another system that used OVS's tc instead of meters to implement basic QoS.  OVN does use meters to implement most modes of QoS.  If you don't want to use meters, you could try looking at the "qos_max_rate" and "qos_burst" options in the ovn-nb man page, but I don't have any experience using them.
&gt;
&gt;--Justin
&gt;
&gt;
&gt;&gt; On Jan 27, 2019, at 11:26 PM, taoyunupt &lt;taoyunupt@126.com&gt; wrote:
&gt;&gt; 
&gt;&gt; The method build_qos in  /ovn/northd/ovn-northd.c is as fellows,in the end of the method,it  adds logical flow by the code of
&gt;&gt; ovn_lflow_add(lflows, od, stage,qos-&gt;priority,qos-&gt;match, ds_cstr(&amp;meter_action));
&gt;&gt; 
&gt;&gt; Does this mean the meter table is the only way for ovn to add Qos?
&gt;&gt; 
&gt;&gt;                           
&gt;&gt; 
&gt;&gt; build_qos(struct ovn_datapath *od, struct hmap *lflows) {
&gt;&gt;     ovn_lflow_add(lflows, od, S_SWITCH_IN_QOS_MARK, 0, "1", "next;");
&gt;&gt;     ovn_lflow_add(lflows, od, S_SWITCH_OUT_QOS_MARK, 0, "1", "next;");
&gt;&gt;     ovn_lflow_add(lflows, od, S_SWITCH_IN_QOS_METER, 0, "1", "next;");
&gt;&gt;     ovn_lflow_add(lflows, od, S_SWITCH_OUT_QOS_METER, 0, "1", "next;");
&gt;&gt; 
&gt;&gt;     for (size_t i = 0; i &lt; od-&gt;nbs-&gt;n_qos_rules; i++) {
&gt;&gt;         struct nbrec_qos *qos = od-&gt;nbs-&gt;qos_rules[i];
&gt;&gt;         bool ingress = !strcmp(qos-&gt;direction, "from-lport") ? true :false;
&gt;&gt;         enum ovn_stage stage = ingress ? S_SWITCH_IN_QOS_MARK : S_SWITCH_OUT_QOS_MARK;
&gt;&gt;         int64_t rate = 0;
&gt;&gt;         int64_t burst = 0;
&gt;&gt; 
&gt;&gt;         for (size_t j = 0; j &lt; qos-&gt;n_action; j++) {
&gt;&gt;             if (!strcmp(qos-&gt;key_action[j], "dscp")) {
&gt;&gt;                 struct ds dscp_action = DS_EMPTY_INITIALIZER;
&gt;&gt; 
&gt;&gt;                 ds_put_format(&amp;dscp_action, "ip.dscp = %"PRId64"; next;",
&gt;&gt;                               qos-&gt;value_action[j]);
&gt;&gt;                 ovn_lflow_add(lflows, od, stage,
&gt;&gt;                               qos-&gt;priority,
&gt;&gt;                               qos-&gt;match, ds_cstr(&amp;dscp_action));
&gt;&gt;                 ds_destroy(&amp;dscp_action);
&gt;&gt;             }
&gt;&gt;         }
&gt;&gt; 
&gt;&gt;         for (size_t n = 0; n &lt; qos-&gt;n_bandwidth; n++) {
&gt;&gt;             if (!strcmp(qos-&gt;key_bandwidth[n], "rate")) {
&gt;&gt;                 rate = qos-&gt;value_bandwidth[n];
&gt;&gt;             } else if (!strcmp(qos-&gt;key_bandwidth[n], "burst")) {
&gt;&gt;                 burst = qos-&gt;value_bandwidth[n];
&gt;&gt;             }
&gt;&gt;         }
&gt;&gt;         if (rate) {
&gt;&gt;             struct ds meter_action = DS_EMPTY_INITIALIZER;
&gt;&gt;             stage = ingress ? S_SWITCH_IN_QOS_METER : S_SWITCH_OUT_QOS_METER;
&gt;&gt;             if (burst) {
&gt;&gt;                 ds_put_format(&amp;meter_action,
&gt;&gt;                               "set_meter(%"PRId64", %"PRId64"); next;",
&gt;&gt;                               rate, burst);
&gt;&gt;             } else {
&gt;&gt;                 ds_put_format(&amp;meter_action,
&gt;&gt;                               "set_meter(%"PRId64"); next;",
&gt;&gt;                               rate);
&gt;&gt;             }
&gt;&gt; 
&gt;&gt;             /* Ingress and Egress QoS Meter Table.
&gt;&gt;              *
&gt;&gt;              * We limit the bandwidth of this flow by adding a meter table.
&gt;&gt;              */
&gt;&gt;             ovn_lflow_add(lflows, od, stage,
&gt;&gt;                           qos-&gt;priority,
&gt;&gt;                           qos-&gt;match, ds_cstr(&amp;meter_action));
&gt;&gt;             ds_destroy(&amp;meter_action);
&gt;&gt;         }
&gt;&gt;     }
&gt;&gt; }
&gt;&gt; 
&gt;&gt; 
&gt;&gt; 
&gt;&gt; 
&gt;&gt; 
&gt;&gt; At 2019-01-28 15:15:51, "Justin Pettit" &lt;jpettit@ovn.org&gt; wrote:
&gt;&gt; &gt;QoS is most likely using the kernel's built-in traffic-shaping algorithms in tc.  Those should work the same on all supported kernels.
&gt;&gt; &gt;
&gt;&gt; &gt;--Justin
&gt;&gt; &gt;
&gt;&gt; &gt;
&gt;&gt; &gt;&gt; On Jan 27, 2019, at 11:10 PM, taoyunupt &lt;taoyunupt@126.com&gt; wrote:
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; Thanks justin,
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; My environment is OVS for the OVN/openstack.I also want to know ,if i must use meter for the  openstack/ovn feature 'Qos'.Does any other methods to achive this?
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; Regards,
&gt;&gt; &gt;&gt; Yunxiang
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; At 2019-01-28 14:58:19, "Justin Pettit" &lt;jpettit@ovn.org&gt; wrote:
&gt;&gt; &gt;&gt; &gt;This is the patch:
&gt;&gt; &gt;&gt; &gt;
&gt;&gt; &gt;&gt; &gt;        http://patchwork.ozlabs.org/patch/950513/
&gt;&gt; &gt;&gt; &gt;
&gt;&gt; &gt;&gt; &gt;I think it was only broken in kernels 4.15, 4.16, and 4.17.  I expect that 4.20 will be fine.
&gt;&gt; &gt;&gt; &gt;
&gt;&gt; &gt;&gt; &gt;--Justin
&gt;&gt; &gt;&gt; &gt;
&gt;&gt; &gt;&gt; &gt;
&gt;&gt; &gt;&gt; &gt;&gt; On Jan 27, 2019, at 10:16 PM, taoyunupt &lt;taoyunupt@126.com&gt; wrote:
&gt;&gt; &gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; &gt;&gt; Hello,justin,
&gt;&gt; &gt;&gt; &gt;&gt;          I  met a supporting problem of meter of OVS 2.10. I found a mail from you,after searching the internet.The address of this mail is "https://www.mail-archive.com/ovs-discuss@openvswitch.org/msg04180.html"
&gt;&gt; &gt;&gt; &gt;&gt;          The kernel version of  "4.20.5-1.el7.elrepo.x86_64" goes well with meter table of ovs,but I want to know how to fit the  maintained older kernels.
&gt;&gt; &gt;&gt; &gt;&gt;          If i want to use ovs with maintained older kernels,which patch you metioned in the mail, should i import ?
&gt;&gt; &gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; &gt;&gt; Regards,
&gt;&gt; &gt;&gt; &gt;&gt; yunxiang
&gt;&gt; &gt;&gt; &gt;&gt; 
&gt;&gt; &gt;&gt; &gt;&gt; _______________________________________________
&gt;&gt; &gt;&gt; &gt;&gt; discuss mailing list
&gt;&gt; &gt;&gt; &gt;&gt; discuss@openvswitch.org
&gt;&gt; &gt;&gt; &gt;&gt; https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
&gt;&gt; &gt;&gt; 
&gt;&gt; 
</pre></div>