|
@@ -151,11 +151,8 @@ struct hfsc_class {
|
|
(monotonic within a period) */
|
|
(monotonic within a period) */
|
|
u64 cl_vtadj; /* intra-period cumulative vt
|
|
u64 cl_vtadj; /* intra-period cumulative vt
|
|
adjustment */
|
|
adjustment */
|
|
- u64 cl_vtoff; /* inter-period cumulative vt offset */
|
|
|
|
- u64 cl_cvtmax; /* max child's vt in the last period */
|
|
|
|
- u64 cl_cvtoff; /* cumulative cvtmax of all periods */
|
|
|
|
- u64 cl_pcvtoff; /* parent's cvtoff at initialization
|
|
|
|
- time */
|
|
|
|
|
|
+ u64 cl_cvtoff; /* largest virtual time seen among
|
|
|
|
+ the children */
|
|
|
|
|
|
struct internal_sc cl_rsc; /* internal real-time service curve */
|
|
struct internal_sc cl_rsc; /* internal real-time service curve */
|
|
struct internal_sc cl_fsc; /* internal fair service curve */
|
|
struct internal_sc cl_fsc; /* internal fair service curve */
|
|
@@ -701,28 +698,16 @@ init_vf(struct hfsc_class *cl, unsigned int len)
|
|
} else {
|
|
} else {
|
|
/*
|
|
/*
|
|
* first child for a new parent backlog period.
|
|
* first child for a new parent backlog period.
|
|
- * add parent's cvtmax to cvtoff to make a new
|
|
|
|
- * vt (vtoff + vt) larger than the vt in the
|
|
|
|
- * last period for all children.
|
|
|
|
|
|
+ * initialize cl_vt to the highest value seen
|
|
|
|
+ * among the siblings. this is analogous to
|
|
|
|
+ * what cur_time would provide in realtime case.
|
|
*/
|
|
*/
|
|
- vt = cl->cl_parent->cl_cvtmax;
|
|
|
|
- cl->cl_parent->cl_cvtoff += vt;
|
|
|
|
- cl->cl_parent->cl_cvtmax = 0;
|
|
|
|
|
|
+ cl->cl_vt = cl->cl_parent->cl_cvtoff;
|
|
cl->cl_parent->cl_cvtmin = 0;
|
|
cl->cl_parent->cl_cvtmin = 0;
|
|
- cl->cl_vt = 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- cl->cl_vtoff = cl->cl_parent->cl_cvtoff -
|
|
|
|
- cl->cl_pcvtoff;
|
|
|
|
-
|
|
|
|
/* update the virtual curve */
|
|
/* update the virtual curve */
|
|
- vt = cl->cl_vt + cl->cl_vtoff;
|
|
|
|
- rtsc_min(&cl->cl_virtual, &cl->cl_fsc, vt,
|
|
|
|
- cl->cl_total);
|
|
|
|
- if (cl->cl_virtual.x == vt) {
|
|
|
|
- cl->cl_virtual.x -= cl->cl_vtoff;
|
|
|
|
- cl->cl_vtoff = 0;
|
|
|
|
- }
|
|
|
|
|
|
+ rtsc_min(&cl->cl_virtual, &cl->cl_fsc, cl->cl_vt, cl->cl_total);
|
|
cl->cl_vtadj = 0;
|
|
cl->cl_vtadj = 0;
|
|
|
|
|
|
cl->cl_vtperiod++; /* increment vt period */
|
|
cl->cl_vtperiod++; /* increment vt period */
|
|
@@ -779,8 +764,7 @@ update_vf(struct hfsc_class *cl, unsigned int len, u64 cur_time)
|
|
go_passive = 0;
|
|
go_passive = 0;
|
|
|
|
|
|
/* update vt */
|
|
/* update vt */
|
|
- cl->cl_vt = rtsc_y2x(&cl->cl_virtual, cl->cl_total)
|
|
|
|
- - cl->cl_vtoff + cl->cl_vtadj;
|
|
|
|
|
|
+ cl->cl_vt = rtsc_y2x(&cl->cl_virtual, cl->cl_total) + cl->cl_vtadj;
|
|
|
|
|
|
/*
|
|
/*
|
|
* if vt of the class is smaller than cvtmin,
|
|
* if vt of the class is smaller than cvtmin,
|
|
@@ -795,9 +779,9 @@ update_vf(struct hfsc_class *cl, unsigned int len, u64 cur_time)
|
|
if (go_passive) {
|
|
if (go_passive) {
|
|
/* no more active child, going passive */
|
|
/* no more active child, going passive */
|
|
|
|
|
|
- /* update cvtmax of the parent class */
|
|
|
|
- if (cl->cl_vt > cl->cl_parent->cl_cvtmax)
|
|
|
|
- cl->cl_parent->cl_cvtmax = cl->cl_vt;
|
|
|
|
|
|
+ /* update cvtoff of the parent class */
|
|
|
|
+ if (cl->cl_vt > cl->cl_parent->cl_cvtoff)
|
|
|
|
+ cl->cl_parent->cl_cvtoff = cl->cl_vt;
|
|
|
|
|
|
/* remove this class from the vt tree */
|
|
/* remove this class from the vt tree */
|
|
vttree_remove(cl);
|
|
vttree_remove(cl);
|
|
@@ -940,7 +924,7 @@ static void
|
|
hfsc_change_fsc(struct hfsc_class *cl, struct tc_service_curve *fsc)
|
|
hfsc_change_fsc(struct hfsc_class *cl, struct tc_service_curve *fsc)
|
|
{
|
|
{
|
|
sc2isc(fsc, &cl->cl_fsc);
|
|
sc2isc(fsc, &cl->cl_fsc);
|
|
- rtsc_init(&cl->cl_virtual, &cl->cl_fsc, cl->cl_vtoff + cl->cl_vt, cl->cl_total);
|
|
|
|
|
|
+ rtsc_init(&cl->cl_virtual, &cl->cl_fsc, cl->cl_vt, cl->cl_total);
|
|
cl->cl_flags |= HFSC_FSC;
|
|
cl->cl_flags |= HFSC_FSC;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1094,7 +1078,6 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
|
|
if (parent->level == 0)
|
|
if (parent->level == 0)
|
|
hfsc_purge_queue(sch, parent);
|
|
hfsc_purge_queue(sch, parent);
|
|
hfsc_adjust_levels(parent);
|
|
hfsc_adjust_levels(parent);
|
|
- cl->cl_pcvtoff = parent->cl_cvtoff;
|
|
|
|
sch_tree_unlock(sch);
|
|
sch_tree_unlock(sch);
|
|
|
|
|
|
qdisc_class_hash_grow(sch, &q->clhash);
|
|
qdisc_class_hash_grow(sch, &q->clhash);
|
|
@@ -1482,11 +1465,8 @@ hfsc_reset_class(struct hfsc_class *cl)
|
|
cl->cl_e = 0;
|
|
cl->cl_e = 0;
|
|
cl->cl_vt = 0;
|
|
cl->cl_vt = 0;
|
|
cl->cl_vtadj = 0;
|
|
cl->cl_vtadj = 0;
|
|
- cl->cl_vtoff = 0;
|
|
|
|
cl->cl_cvtmin = 0;
|
|
cl->cl_cvtmin = 0;
|
|
- cl->cl_cvtmax = 0;
|
|
|
|
cl->cl_cvtoff = 0;
|
|
cl->cl_cvtoff = 0;
|
|
- cl->cl_pcvtoff = 0;
|
|
|
|
cl->cl_vtperiod = 0;
|
|
cl->cl_vtperiod = 0;
|
|
cl->cl_parentperiod = 0;
|
|
cl->cl_parentperiod = 0;
|
|
cl->cl_f = 0;
|
|
cl->cl_f = 0;
|