On 4/25/23 14:51, Simon Horman wrote:
On Fri, Apr 21, 2023 at 05:16:48PM +0200, Adrian Moreno wrote:
Currently, htb rates are capped at ~34Gbps because they are internally
expressed as 32-bit fields.

Move min and max rates to 64-bit fields and use TCA_HTB_RATE64 and
TCA_HTB_CEIL64 to configure HTC classes to break this barrier.

In order to test this, create a dummy tuntap device and set it's
speed to a very high value so we can try adding a QoS queue with big
rates.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2137619
Signed-off-by: Adrian Moreno <amore...@redhat.com>
---
  acinclude.m4            |  7 +++++
  lib/netdev-linux.c      | 61 +++++++++++++++++++++++++++++------------
  tests/system-traffic.at | 31 +++++++++++++++++++++
  3 files changed, 81 insertions(+), 18 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index ac1eab790..3bce2a652 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -211,6 +211,13 @@ AC_DEFUN([OVS_CHECK_LINUX_TC], [
      ])],
      [AC_DEFINE([HAVE_TCA_STATS_PKT64], [1],
                 [Define to 1 if TCA_STATS_PKT64 is available.])])
+
+  AC_COMPILE_IFELSE([
+    AC_LANG_PROGRAM([#include <linux/pkt_sched.h>], [
+        int x = TCA_HTB_RATE64;
+    ])],
+    [AC_DEFINE([HAVE_TCA_HTB_RATE64], [1],
+               [Define to 1 if TCA_HTB_RATE64 is available.])])
  ])
dnl OVS_CHECK_LINUX_SCTP_CT

...

--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -2354,6 +2354,37 @@ AT_CHECK([tc class show dev ovs-p1 | grep -q 'class htb 
.* HTB_CONF'])
  OVS_TRAFFIC_VSWITCHD_STOP
  AT_CLEANUP
+AT_SETUP([QoS - 64bit])
+AT_SKIP_IF([test $HAVE_TC = no])
+OVS_TRAFFIC_VSWITCHD_START()

Hi Adrian,


Hi Simon,
Thanks for the review.


Should this test be conditional on HAVE_TCA_STATS_PKT64 and
HAVE_TCA_HTB_RATE64? If so, perhaps something like
CHECK_TC_INGRESS_PPS() is appropriate.


Let me make sure I understand your proposal: You're suggesting adding a function similar to CHECK_TC_INGRESS_PPS() that ensures that the running kernel supports TCA_STATS_PKT64 and makes the test fail early if it doesn't. Is that it?


+
+ADD_NAMESPACES(at_ns0, at_ns1)
+ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
+ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
+
+dnl Adding a custom qdisc to ovs-p1, ovs-p0 will have the default qdisc.
+AT_CHECK([tc qdisc add dev ovs-p1 root noqueue])
+AT_CHECK([tc qdisc show dev ovs-p1 | grep -q noqueue])
+
+dnl Configure the QoS with rates that require 64bits, i.e: > 34Gbps.
+AT_CHECK([ovs-vsctl set port ovs-p0 qos=@qos -- set port ovs-p1 qos=@qos dnl
+            -- --id=@qos create qos dnl
+               type=linux-htb other-config:max-rate=50000000000 
queues:0=@queue dnl
+            -- --id=@queue create queue dnl
+               other_config:min-rate=40000000000 
other_config:max-rate=50000000000 dnl
+               other_config:burst=50000000000],
+         [ignore], [ignore])
+
+OVS_WAIT_UNTIL([tc qdisc show dev ovs-p0 | grep -q htb])
+OVS_WAIT_UNTIL([tc qdisc show dev ovs-p1 | grep -q htb])
+
+m4_define([HTB_CONF], [rate 40Gbit ceil 50Gbit burst 1955030000b cburst 
1955031250b])
+AT_CHECK([tc class show dev ovs-p0 | grep -q 'class htb .* HTB_CONF'])
+AT_CHECK([tc class show dev ovs-p1 | grep -q 'class htb .* HTB_CONF'])
+
+OVS_TRAFFIC_VSWITCHD_STOP
+AT_CLEANUP
+
  AT_BANNER([conntrack])
AT_SETUP([conntrack - controller])
--
2.39.2

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev



--
Adrián Moreno

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to