[Devel] [PATCH RHEL7 COMMIT] net/sched: restore "mpu xxx" handling

Konstantin Khorenko khorenko at virtuozzo.com
Wed Aug 26 06:50:37 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.2
------>
commit e338c4be75d80bfd68ab025a7c963d08386b5d63
Author: Kirill Tkhai <ktkhai at odin.com>
Date:   Wed Aug 26 17:50:37 2015 +0400

    net/sched: restore "mpu xxx" handling
    
    commit 56b765b79 ("htb: improved accuracy at high rates")
    broke the "mpu xxx" handling.
    
    This patch restores the "mpu xxx" handling for htb:
    
    # tc class add dev eth0 classid 1:2 parent 1: htb rate 1mbit mpu 0
    # ping -f -c 1000 10.30.22.52
    rtt min/avg/max/mdev = 0.156/1.881/2.454/0.175 ms, ipg/ewma 1.908/1.925 ms
    
    # tc class change dev eth0 classid 1:2 parent 1: htb rate 1mbit mpu 1000
    # ping -f -c 1000 10.30.22.52
    rtt min/avg/max/mdev = 15.352/22.229/38.646/2.212 ms, pipe 3, ipg/ewma 15.999/22.609 ms
    
    https://jira.sw.ru/browse/PSBM-34874
    https://patchwork.ozlabs.org/patch/501666/
    
    Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
---
 include/net/sch_generic.h | 4 ++++
 net/sched/sch_htb.c       | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index de28b07..5a9e3a4 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -689,11 +689,15 @@ struct psched_ratecfg {
 	u16	overhead;
 	u8	linklayer;
 	u8	shift;
+	u32	mpu;
 };
 
 static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
 				unsigned int len)
 {
+	if (len < r->mpu)
+		len = r->mpu;
+
 	len += r->overhead;
 
 	if (unlikely(r->linklayer == TC_LINKLAYER_ATM))
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 863846c..b8e22ef 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1109,6 +1109,8 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
 	opt.buffer = PSCHED_NS2TICKS(cl->buffer);
 	psched_ratecfg_getrate(&opt.ceil, &cl->ceil);
 	opt.cbuffer = PSCHED_NS2TICKS(cl->cbuffer);
+	opt.rate.mpu = cl->rate.mpu;
+	opt.ceil.mpu = cl->ceil.mpu;
 	opt.quantum = cl->quantum;
 	opt.prio = cl->prio;
 	opt.level = cl->level;
@@ -1493,6 +1495,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
 
 	psched_ratecfg_precompute(&cl->rate, &hopt->rate);
 	psched_ratecfg_precompute(&cl->ceil, &hopt->ceil);
+	cl->rate.mpu = hopt->rate.mpu;
+	cl->ceil.mpu = hopt->ceil.mpu;
 
 	cl->buffer = PSCHED_TICKS2NS(hopt->buffer);
 	cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer);



More information about the Devel mailing list