lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 22 Aug 2022 02:12:45 -0700
From:   Peilin Ye <yepeilin.cs@...il.com>
To:     "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Jonathan Corbet <corbet@....net>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>
Cc:     Peilin Ye <peilin.ye@...edance.com>, netdev@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        Cong Wang <cong.wang@...edance.com>,
        Stephen Hemminger <stephen@...workplumber.org>,
        Dave Taht <dave.taht@...il.com>,
        Peilin Ye <yepeilin.cs@...il.com>
Subject: [PATCH RFC v2 net-next 4/5] net/sched: sch_htb: Use Qdisc backpressure infrastructure

From: Peilin Ye <peilin.ye@...edance.com>

Recently we introduced a Qdisc backpressure infrastructure (currently
supports UDP sockets).  Use it in HTB Qdisc.

Tested with 500 Mbits/sec rate limit using 16 iperf UDP 1 Gbit/sec
clients.  Before:

[  3]  0.0-15.0 sec  54.2 MBytes  30.4 Mbits/sec   0.875 ms 1245750/1284444 (97%)
[  3]  0.0-15.0 sec  54.2 MBytes  30.3 Mbits/sec   1.288 ms 1238753/1277402 (97%)
[  3]  0.0-15.0 sec  54.8 MBytes  30.6 Mbits/sec   1.761 ms 1261762/1300817 (97%)
[  3]  0.0-15.0 sec  53.9 MBytes  30.1 Mbits/sec   1.635 ms 1241690/1280133 (97%)
<...>                                                       ^^^^^^^^^^^^^^^^^^^^^

Total throughput is 482.0 Mbits/sec and average drop rate is 97.0%.

Now enable Qdisc backpressure for UDP sockets, with
udp_backpressure_interval default to 100 milliseconds:

[  3]  0.0-15.0 sec  53.0 MBytes  29.6 Mbits/sec   1.621 ms 54/37856 (0.14%)
[  3]  0.0-15.0 sec  55.9 MBytes  31.3 Mbits/sec   1.368 ms  6/39895 (0.015%)
[  3]  0.0-15.0 sec  52.3 MBytes  29.2 Mbits/sec   1.560 ms 56/37340 (0.15%)
[  3]  0.0-15.0 sec  52.7 MBytes  29.5 Mbits/sec   1.495 ms 57/37677 (0.15%)
<...>                                                       ^^^^^^^^^^^^^^^^

Total throughput is 485.9 Mbits/sec (0.81% higher) and average drop rate
is 0.1% (99.9% lower).

Fairness between flows is slightly affected, with per-flow average
throughput ranging from 29.2 to 31.8 Mbits/sec (compared with 29.7 to
30.6 Mbits/sec).

Signed-off-by: Peilin Ye <peilin.ye@...edance.com>
---
 net/sched/sch_htb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 23a9d6242429..e337b3d0dab3 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -623,6 +623,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 			__qdisc_enqueue_tail(skb, &q->direct_queue);
 			q->direct_pkts++;
 		} else {
+			qdisc_backpressure(skb);
 			return qdisc_drop(skb, sch, to_free);
 		}
 #ifdef CONFIG_NET_CLS_ACT
@@ -634,6 +635,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 #endif
 	} else if ((ret = qdisc_enqueue(skb, cl->leaf.q,
 					to_free)) != NET_XMIT_SUCCESS) {
+		qdisc_backpressure(skb);
 		if (net_xmit_drop_count(ret)) {
 			qdisc_qstats_drop(sch);
 			cl->drops++;
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ