@@ -88,6 +88,7 @@ struct internal_sc {
u64 dy; /* the y-projection of the 1st segment */
u64 sm2; /* scaled slope of the 2nd segment */
u64 ism2; /* scaled inverse-slope of the 2nd segment */
+ u64 i2dy; /* x-projection of dy, using 2nd slope */
};
/* runtime service curve */
@@ -531,6 +532,7 @@ sc2isc(struct tc_service_curve *sc, struct internal_sc *isc)
isc->dy = seg_x2y(isc->dx, isc->sm1);
isc->sm2 = m2sm(sc->m2);
isc->ism2 = m2ism(sc->m2);
+ isc->i2dy = seg_y2x(isc->dy, isc->ism2);
}
/*
@@ -885,8 +887,8 @@ set_passive(struct hfsc_class *cl)
break;
/* update cl_cvtoff of the parent class */
- if (cl->cl_vt > cl->cl_parent->cl_cvtoff)
- cl->cl_parent->cl_cvtoff = cl->cl_vt;
+ if (cl->cl_vt + cl->cl_fsc.i2dy > cl->cl_parent->cl_cvtoff)
+ cl->cl_parent->cl_cvtoff = cl->cl_vt + cl->cl_fsc.i2dy;
/* remove this class from the parent's vt & cf trees */
vttree_remove(cl);