Skip to contentSkip to conversation

tc: pie: make tc/q_pie.c consistent with the kernel

PATCH New Leslie Monis 1 participant 3 messages Mar 27, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover tc: pie: make tc/q_pie.c consistent with the kernel

The PIE qdisc implementation in Linux has recently been aligned with RFC 8033. This patch series makes tc/q_pie.c consistent with that implementation and also updates the man page tc-pie(8).

Changes from v1 to v2:
- Used UINT64_MAX instead of 0xffffffffffffffff as suggested by Stephen.

Leslie Monis (2):
tc: pie: change maximum integer value of tc_pie_xstats->prob
tc: pie: update man page

 man/man8/tc-pie.8 | 40 ++++++++++++++++++----------------------
 man/man8/tc.8     |  1 +
 tc/q_pie.c        |  2 +-
 3 files changed, 20 insertions(+), 23 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 tc: pie: change maximum integer value of tc_pie_xstats->prob

tc_pie_xstats->prob has a maximum value of (2^64 - 1).

---
 tc/q_pie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tc/q_pie.c +1 -1
index f7924ef5..236ea31b 100644
@@ -198,7 +198,7 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f,
 	st = RTA_DATA(xstats);
 	/*prob is returned as a fracion of maximum integer value */
 	fprintf(f, "prob %f delay %uus avg_dq_rate %u\n",
-		(double)st->prob / (double)0xffffffff, st->delay,
+		(double)st->prob / UINT64_MAX, st->delay,
 		st->avg_dq_rate);
 	fprintf(f, "pkts_in %u overlimit %u dropped %u maxq %u ecn_mark %u\n",
 		st->packets_in, st->overlimit, st->dropped, st->maxq,
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/2 tc: pie: update man page

In reply to Leslie Monis

Update man page to reflect the changes made in Linux.

---
 man/man8/tc-pie.8 | 40 ++++++++++++++++++----------------------
 man/man8/tc.8     |  1 +
 2 files changed, 19 insertions(+), 22 deletions(-)
man/man8/tc-pie.8 +18 -22
index 278293bd..a302132f 100644
@@ -60,10 +60,10 @@ limit on the queue size in packets. Incoming packets are dropped when this limit
 is reached. Default is 1000 packets.
 
 .SS target
-is the expected queue delay. The default target delay is 20ms.
+is the expected queue delay. The default target delay is 15ms.
 
 .SS tupdate
-is the frequency at which the system drop probability is calculated. The default is 30ms.
+is the frequency at which the system drop probability is calculated. The default is 15ms.
 
 .SS alpha
 .SS beta
@@ -91,29 +91,27 @@ is turned off.
 .SH EXAMPLES
  # tc qdisc add dev eth0 root pie
  # tc -s qdisc show
-   qdisc pie 8034: dev eth0 root refcnt 2 limit 200p target 19000us tupdate 29000us alpha 2 beta 20
-   Sent 7443524 bytes 7204 pkt (dropped 900, overlimits 0 requeues 0)
-   backlog 38998b 37p requeues 0
-   prob 0.123384 delay 25000us avg_dq_rate 1464840
-   pkts_in 7241 overlimit 900 dropped 0 maxq 186 ecn_mark 0
+   qdisc pie 8036: dev eth0 root refcnt 2 limit 1000p target 15.0ms tupdate 16.0ms alpha 2 beta 20
+    Sent 31216108 bytes 20800 pkt (dropped 80, overlimits 0 requeues 0)
+    backlog 16654b 11p requeues 0
+   prob 0.006161 delay 15666us avg_dq_rate 1159667
+   pkts_in 20811 overlimit 0 dropped 80 maxq 50 ecn_mark 0
 
  # tc qdisc add dev eth0 root pie limit 100 target 20ms tupdate 30ms ecn
  # tc -s qdisc show
-   qdisc pie 8036: dev eth0 root refcnt 2 limit 200p target 19000 tupdate 29000 alpha 2 beta 20 ecn
-   Sent 2491922 bytes 2507 pkt (dropped 214, overlimits 0 requeues 0)
-   backlog 33728b 32p requeues 0
-   prob 0.102262 delay 24000us avg_dq_rate 1464840
-   pkts_in 2468 overlimit 214 dropped 0 maxq 192 ecn_mark 71
-
+   qdisc pie 8036: dev eth0 root refcnt 2 limit 100p target 20.0ms tupdate 32.0ms alpha 2 beta 20 ecn
+    Sent 6591724 bytes 4442 pkt (dropped 27, overlimits 0 requeues 0)
+    backlog 18168b 12p requeues 0
+   prob 0.008845 delay 11348us avg_dq_rate 1342773
+   pkts_in 4454 overlimit 0 dropped 27 maxq 65 ecn_mark 0
 
  # tc qdisc add dev eth0 root pie limit 100 target 50ms tupdate 30ms bytemode
  # tc -s qdisc show
-   qdisc pie 8036: dev eth0 root refcnt 2 limit 200p target 19000 tupdate 29000 alpha 2 beta 20 ecn
-   Sent 2491922 bytes 2507 pkt (dropped 214, overlimits 0 requeues 0)
-   backlog 33728b 32p requeues 0
-   prob 0.102262 delay 24000us avg_dq_rate 1464840
-   pkts_in 2468 overlimit 214 dropped 0 maxq 192 ecn_mark 71
-
+   qdisc pie 8036: dev eth0 root refcnt 2 limit 100p target 50.0ms tupdate 32.0ms alpha 2 beta 20 bytemode
+    Sent 1616274 bytes 1137 pkt (dropped 0, overlimits 0 requeues 0)
+    backlog 13626b 9p requeues 0
+   prob 0.000000 delay 0us avg_dq_rate 0
+   pkts_in 1146 overlimit 0 dropped 0 maxq 23 ecn_mark 0
 
 .SH SEE ALSO
 .BR tc (8),
@@ -121,9 +119,7 @@ is turned off.
 .BR tc-red (8)
 
 .SH SOURCES
- o IETF draft submission is at http://tools.ietf.org/html/draft-pan-tsvwg-pie-00
- o IEEE  Conference on High Performance Switching and Routing 2013 : "PIE: A
-Lightweight Control Scheme to Address the Bufferbloat Problem"
+ o RFC 8033: https://tools.ietf.org/html/rfc8033
 
 .SH AUTHORS
 PIE was implemented by Vijay Subramanian and Mythili Prabhu, also the authors of
man/man8/tc.8 +1 -0
index f98398a3..ab0bad8a 100644
@@ -848,6 +848,7 @@ was written by Alexey N. Kuznetsov and added in Linux 2.2.
 .BR tc-mqprio (8),
 .BR tc-pfifo (8),
 .BR tc-pfifo_fast (8),
+.BR tc-pie (8),
 .BR tc-red (8),
 .BR tc-route (8),
 .BR tc-sfb (8),
Signature · 1 line
2.17.1