<div dir="ltr">Hey Dumitru,<div><br></div><div>thanks for the finding. </div><div>I created bugzilla to track this: [1].</div><div>If we would introduce QoS support for Port Group we also need to be sure that every Group member will have separate meters.</div><div><br></div><div>[1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1817606">https://bugzilla.redhat.com/show_bug.cgi?id=1817606</a></div><div><br></div><div>Thanks again,</div><div>Maciej</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 25, 2020 at 3:04 PM Dumitru Ceara <<a href="mailto:dceara@redhat.com">dceara@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/24/20 2:33 PM, Maciej Jozefczyk wrote:<br>
> Hi all!<br>
> <br>
> I have the following setup:<br>
> - Logical Switch with 3 Logical Ports that are VMs:<br>
>    * 1 LSP from which i test QoS with iperf3<br>
>    * 2 LSPs have QoS policy set.<br>
> <br>
> Configured QoS rules:<br>
> --------------------------------------------------------------------------------------------------------<br>
> stack@mjozefcz-devstack-qos:~$ ovn-nbctl list qos<br>
> _uuid               : 7ad43edb-ed2a-4279-8373-f925a6591508<br>
> action              : {}<br>
> bandwidth           : {burst=10000, rate=10000}<br>
> direction           : from-lport<br>
> external_ids        : {}<br>
> match               : "inport == \"0dbccc4f-5c36-406e-a629-70d49d52e391\""<br>
> priority            : 2002<br>
> <br>
> _uuid               : 8ecac46b-1ec0-4e76-a9e0-0b3063fc79e0<br>
> action              : {}<br>
> bandwidth           : {burst=10000, rate=10000}<br>
> direction           : from-lport<br>
> external_ids        : {}<br>
> match               : "inport == \"cad88274-feea-4ddb-b8c1-af49ca8833cf\""<br>
> priority            : 2002<br>
> stack@mjozefcz-devstack-qos:~$ <br>
> --------------------------------------------------------------------------------------------------------<br>
> Please note that the rules have the same bandwidth configuration.<br>
> Those QoS rules are mapped for those two logical flows:<br>
> <br>
> -----------------------------------------------------------------------------------------------------------------------------------------------<br>
> stack@mjozefcz-devstack-qos:~$ ovn-sbctl list logical_flow<br>
> 7ae15276-6869-40ac-be1d-b4707dcf5dc7<br>
> _uuid               : 7ae15276-6869-40ac-be1d-b4707dcf5dc7<br>
> actions             : "set_meter(10000, 10000); next;"<br>
> external_ids        : {source="ovn-northd.c:5451",<br>
> stage-hint="8ecac46b", stage-name=ls_in_qos_meter}<br>
> logical_datapath    : 9a1af1f9-7b42-43c2-ab0b-f4796d209e63<br>
> match               : "inport == \"cad88274-feea-4ddb-b8c1-af49ca8833cf\""<br>
> pipeline            : ingress<br>
> priority            : 2002<br>
> table_id            : 8<br>
> hash                : 0<br>
> stack@mjozefcz-devstack-qos:~$ ovn-sbctl list logical_flow<br>
> f541520a-ef70-4038-8ee5-b5b609fc3883<br>
> _uuid               : f541520a-ef70-4038-8ee5-b5b609fc3883<br>
> actions             : "set_meter(10000, 10000); next;"<br>
> external_ids        : {source="ovn-northd.c:5451",<br>
> stage-hint="7ad43edb", stage-name=ls_in_qos_meter}<br>
> logical_datapath    : 9a1af1f9-7b42-43c2-ab0b-f4796d209e63<br>
> match               : "inport == \"0dbccc4f-5c36-406e-a629-70d49d52e391\""<br>
> pipeline            : ingress<br>
> priority            : 2002<br>
> table_id            : 8<br>
> hash                : 0<br>
> stack@mjozefcz-devstack-qos:~$ <br>
> -----------------------------------------------------------------------------------------------------------------------------------------------<br>
> <br>
> The problem is that those two rules use the same meter (meter id 2):<br>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
> stack@mjozefcz-devstack-qos:~$ sudo ovs-ofctl -O OpenFlow13 dump-flows<br>
> br-int | grep meter<br>
>  cookie=0xf541520a, duration=4215.163s, table=16, n_packets=12497,<br>
> n_bytes=15463221, priority=2002,reg14=0x4,metadata=0x1<br>
> actions=meter:2,resubmit(,17)<br>
>  cookie=0x7ae15276, duration=4215.163s, table=16, n_packets=13789,<br>
> n_bytes=33132305, priority=2002,reg14=0x5,metadata=0x1<br>
> actions=meter:2,resubmit(,17)<br>
> stack@mjozefcz-devstack-qos:~$ sudo ovs-ofctl -O OpenFlow13 dump-meters<br>
> br-int<br>
> OFPST_METER_CONFIG reply (OF1.3) (xid=0x2):<br>
> meter=2 kbps burst stats bands=<br>
> type=drop rate=10000 burst_size=10000<br>
> stack@mjozefcz-devstack-qos:~$ sudo ovs-ofctl -O OpenFlow13 meter-stats<br>
> br-int<br>
> OFPST_METER reply (OF1.3) (xid=0x2):<br>
> meter:2 flow_count:2 packet_in_count:21607 byte_in_count:40746921<br>
> duration:4158.558s bands:<br>
> 0: packet_count:2010 byte_count:6486212<br>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
> <br>
> So if there are more than one Logical Switch Ports from the same Logical<br>
> Switch bound on the chassis that share the same QoS BW limit settings,<br>
> those also share the same meter.<br>
> That ends with slitted bw limit across those Logical Switch Ports.<br>
> I tested it using iperf3, the results:<br>
> <br>
> If only one LSP consumes the limit:<br>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
> stack@mjozefcz-devstack-qos:~$ sudo ip netns exec<br>
> ovnmeta-9a1af1f9-7b42-43c2-ab0b-f4796d209e63 iperf3 -R -O 1 -c 10.1.0.20<br>
> Connecting to host 10.1.0.20, port 5201<br>
> Reverse mode, remote host 10.1.0.20 is sending<br>
> [  4] local 10.1.0.2 port 57206 connected to 10.1.0.20 port 5201<br>
> [ ID] Interval           Transfer     Bandwidth<br>
> [  4]   0.00-1.00   sec  3.49 MBytes  29.3 Mbits/sec                <br>
>  (omitted)<br>
> [  4]   0.00-1.00   sec  1.06 MBytes  8.86 Mbits/sec                  <br>
> [  4]   1.00-2.00   sec  1.37 MBytes  11.5 Mbits/sec                  <br>
> [  4]   2.00-3.00   sec  1.16 MBytes  9.71 Mbits/sec                  <br>
> [  4]   3.00-4.00   sec  1.17 MBytes  9.80 Mbits/sec                  <br>
> [  4]   4.00-5.00   sec  1.17 MBytes  9.84 Mbits/sec                  <br>
> [  4]   5.00-6.00   sec  1.13 MBytes  9.46 Mbits/sec                  <br>
> [  4]   6.00-7.00   sec  1.04 MBytes  8.76 Mbits/sec                  <br>
> [  4]   7.00-8.00   sec  1.26 MBytes  10.6 Mbits/sec                  <br>
> [  4]   8.00-9.00   sec  1.06 MBytes  8.88 Mbits/sec                  <br>
> [  4]   9.00-10.00  sec  1.33 MBytes  11.2 Mbits/sec                  <br>
> - - - - - - - - - - - - - - - - - - - - - - - - -<br>
> [ ID] Interval           Transfer     Bandwidth       Retr<br>
> [  4]   0.00-10.00  sec  11.7 MBytes  9.78 Mbits/sec  2554            <br>
> sender<br>
> [  4]   0.00-10.00  sec  11.7 MBytes  9.85 Mbits/sec                <br>
>  receiver<br>
> <br>
> iperf Done.<br>
> stack@mjozefcz-devstack-qos:~$ <br>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
> <br>
> If two VMs are using the meter - two iperf3 tests at the same time:<br>
> stack@mjozefcz-devstack-qos:~$ sleep 1; sudo ip netns exec<br>
> ovnmeta-9a1af1f9-7b42-43c2-ab0b-f4796d209e63 iperf3 -R -c 1<br>
> 0.1.0.16<br>
> Connecting to host 10.1.0.16, port 5201<br>
> Reverse mode, remote host 10.1.0.16 is sending<br>
> [  4] local 10.1.0.2 port 56874 connected to 10.1.0.16 port 5201<br>
> [ ID] Interval           Transfer     Bandwidth<br>
> [  4]   0.00-1.00   sec  3.39 MBytes  28.5 Mbits/sec                  <br>
> [  4]   1.00-2.00   sec  69.6 KBytes   570 Kbits/sec                  <br>
> [  4]   2.00-3.00   sec   456 KBytes  3.74 Mbits/sec                  <br>
> [  4]   3.00-4.00   sec   290 KBytes  2.38 Mbits/sec                  <br>
> [  4]   4.00-5.00   sec   534 KBytes  4.37 Mbits/sec                  <br>
> [  4]   5.00-6.00   sec   324 KBytes  2.65 Mbits/sec                  <br>
> [  4]   6.00-7.00   sec  16.8 KBytes   137 Kbits/sec                  <br>
> [  4]   7.00-8.00   sec   474 KBytes  3.89 Mbits/sec                  <br>
> [  4]   8.00-9.00   sec   400 KBytes  3.27 Mbits/sec                  <br>
> [  4]   9.00-10.00  sec   750 KBytes  6.15 Mbits/sec                  <br>
> - - - - - - - - - - - - - - - - - - - - - - - - -<br>
> [ ID] Interval           Transfer     Bandwidth       Retr<br>
> [  4]   0.00-10.00  sec  6.92 MBytes  5.80 Mbits/sec  867             sender<br>
> [  4]   0.00-10.00  sec  6.63 MBytes  5.56 Mbits/sec                <br>
>  receiver<br>
> <br>
> iperf Done.<br>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
> <br>
> Questions:<br>
> - Can we create separate meter for each QoS row, to not share the same<br>
> meter if the rules are the same (except match)?<br>
<br>
Hi Maciej,<br>
<br>
>From what I see the problem is that we assign meter IDs based only on<br>
the rate and burst specified in the "set_meter()" action [1].<br>
<br>
I guess we should probably change the set_meter() action such that<br>
ovn-northd specifies another field (maybe port or "match" or some other<br>
unique id?) to be used when building the meter name. This should create<br>
unique meters.<br>
<br>
I amm however not too familiar with the implementation details of the<br>
QoS functionality so maybe there are other options.<br>
<br>
Regards,<br>
Dumitru<br>
<br>
[1] <a href="https://github.com/ovn-org/ovn/blob/v20.03.0/lib/actions.c#L2786" rel="noreferrer" target="_blank">https://github.com/ovn-org/ovn/blob/v20.03.0/lib/actions.c#L2786</a><br>
<br>
> - If we would introduce QoS for Port Groups [1], can we also use<br>
> separate meters?<br>
> <br>
> Versions used:<br>
> - OVN 20.03<br>
> - OVS<br>
> <br>
> Thanks,<br>
> Maciej<br>
> <br>
> [1] <a href="https://mail.openvswitch.org/pipermail/ovs-discuss/2020-March/049864.html" rel="noreferrer" target="_blank">https://mail.openvswitch.org/pipermail/ovs-discuss/2020-March/049864.html</a><br>
> <br>
> -- <br>
> Best regards,<br>
> Maciej Józefczyk<br>
> <br>
> _______________________________________________<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Best regards,<div>Maciej Józefczyk</div></div></div></div></div>