net: pkt_sched: PIE AQM scheme
Subsystems (3)
PATCH v3 1/1 net: pkt_sched: PIE AQM scheme
From: Vijay Subramanian <[email protected]>
Proportional Integral controller Enhanced (PIE) is a scheduler to address the bufferbloat problem.
Quoted 1 line
From the IETF draft below:
"Bufferbloat is a phenomenon where excess buffers in the network cause high latency and jitter. As more and more interactive applications (e.g. voice over IP, real time video streaming and financial transactions) run in the Internet, high latency and jitter degrade application performance. There is a pressing need to design intelligent queue management schemes that can control latency and jitter; and hence provide desirable quality of service to users.
We present here a lightweight design, PIE(Proportional Integral controller Enhanced) that can effectively control the average queueing latency to a target value. Simulation results, theoretical analysis and Linux testbed results have shown that PIE can ensure low latency and achieve high link utilization under various congestion situations. The design does not require per-packet timestamp, so it incurs very small overhead and is simple enough to implement in both hardware and software."
Many thanks to Dave Taht for extensive feedback, reviews, testing and suggestions. Thanks also to Stephen Hemminger for initial review and suggestion
to use psched and friends. Naeem Khademi and Dave Taht independently
contributed to ECN support.
For more information, please see technical paper about PIE in the IEEE Conference on High Performance Switching and Routing 2013. A copy of the paper can be found at ftp://ftpeng.cisco.com/pie/.
Please also refer to the IETF draft submission at
http://tools.ietf.org/html/draft-pan-tsvwg-pie-00
All relevant code, documents and test scripts and results can be found at ftp://ftpeng.cisco.com/pie/.
For problems with the iproute2/tc or Linux kernel code, please contact Vijay Subramanian ([email protected] or [email protected]) or Mythili Prabhu ([email protected])
---
Changes from V2: Prevent timer deadlock on qdisc destroy. Also maintain timer period 'tupdate' in us throughout instead of in psched units.
Changes from V1: Addressed review comments regarding coding style and various implementation issues. In particular 1) add locking for the timer and 2) use psched timer directly instead of a custom timer based on psched.
include/uapi/linux/pkt_sched.h | 26 ++ net/sched/Kconfig | 13 + net/sched/Makefile | 1 + net/sched/sch_pie.c | 558 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 598 insertions(+) create mode 100644 net/sched/sch_pie.c
include/uapi/linux/pkt_sched.h +26 -0
@@ -787,4 +787,30 @@ struct tc_fq_qd_stats {__u32 throttled_flows; __u32 pad; }; + +/*PIE*/ +enum { +TCA_PIE_UNSPEC , +TCA_PIE_TARGET , +TCA_PIE_LIMIT , +TCA_PIE_TUPDATE , +TCA_PIE_ALPHA , +TCA_PIE_BETA , +TCA_PIE_ECN , +TCA_PIE_BYTEMODE , + __TCA_PIE_MAX +}; +#define TCA_PIE_MAX (__TCA_PIE_MAX - 1) + +struct tc_pie_xstats { +__u32 prob;/* current probability */ +__u32 delay;/* current delay in ms */ +__u32 avg_dq_rate;/* current average dq_rate in bits/pie_time */ +__u32 packets_in;/* total number of packets enqueued */ +__u32 dropped;/* packets dropped due to pie_action */ +__u32 overlimit;/* dropped due to lack of space in queue */ +__u32 maxq;/* maximum queue size */ +__u32 ecn_mark;/* packets marked with ecn*/ +}; +#endif
net/sched/Kconfig +13 -0
@@ -286,6 +286,19 @@ config NET_SCH_FQ If unsure, say N. +config NET_SCH_PIE + tristate "Proportional Integral controller Enhanced (PIE) scheduler" + help + Say Y here if you want to use the Proportional Integral controller + Enhanced) scheduler packet scheduling algorithm. + For more information, please see + http://tools.ietf.org/html/draft-pan-tsvwg-pie-00 + + To compile this driver as a module, choose M here: the module + will be called sch_pie. + + If unsure, say N. + config NET_SCH_INGRESS tristate "Ingress Qdisc" depends on NET_CLS_ACT
net/sched/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_NET_SCH_QFQ) += sch_qfq.o obj-$(CONFIG_NET_SCH_CODEL) += sch_codel.o obj-$(CONFIG_NET_SCH_FQ_CODEL) += sch_fq_codel.o obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o +obj-$(CONFIG_NET_SCH_PIE) += sch_pie.o obj-$(CONFIG_NET_CLS_U32) += cls_u32.o obj-$(CONFIG_NET_CLS_ROUTE4) += cls_route.o
net/sched/sch_pie.c new file +558 -0
558 lines not on this page · raw message
Signature · 1 line
1.7.9.5
net/sched/sch_pie.c line 151
Quoted 9 lines · Vijay Subramanian
net/sched/sch_pie.c new file +9
-0+ +if (!drop_early (sch, skb->len)) { +/* we can enqueue the packet */ + q->stats.packets_in++; + +if (qdisc_qlen (sch) > q->stats.maxq) + q->stats.maxq =qdisc_qlen (sch); + +return qdisc_enqueue_tail (skb, sch);
I am not sure why you mix skb->len and qdisc_len(skb)
Also, a default 200 packets limit sounds strange, was it actually tested on a 10Gb link ?
Other than that, patch seems fine, thanks !
Thanks for the reviews, Eric.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ + return qdisc_enqueue_tail(skb, sch);I am not sure why you mix
skb->lenandqdisc_len(skb)
I will refactor the code to update the stats more cleanly.
Quoted 4 lines
Also, a default 200 packets limit sounds strange, was it actually tested on a 10Gb link ?
No. It was tested on 1 Gbps link. Increasing limit to a default of 1000 should be fine.
I will send v4 after some tests to make sure nothing breaks.
Thanks,
Vijay