• Home
  • Raw
  • Download

Lines Matching refs:agg

139 	struct qfq_aggregate *agg;	/* Parent aggregate. */  member
253 static void qfq_init_agg(struct qfq_sched *q, struct qfq_aggregate *agg, in qfq_init_agg() argument
256 INIT_LIST_HEAD(&agg->active); in qfq_init_agg()
257 hlist_add_head(&agg->nonfull_next, &q->nonfull_aggs); in qfq_init_agg()
259 agg->lmax = lmax; in qfq_init_agg()
260 agg->class_weight = weight; in qfq_init_agg()
266 struct qfq_aggregate *agg; in qfq_find_agg() local
268 hlist_for_each_entry(agg, &q->nonfull_aggs, nonfull_next) in qfq_find_agg()
269 if (agg->lmax == lmax && agg->class_weight == weight) in qfq_find_agg()
270 return agg; in qfq_find_agg()
277 static void qfq_update_agg(struct qfq_sched *q, struct qfq_aggregate *agg, in qfq_update_agg() argument
283 hlist_del_init(&agg->nonfull_next); in qfq_update_agg()
285 if (agg->num_classes > new_num_classes && in qfq_update_agg()
287 hlist_add_head(&agg->nonfull_next, &q->nonfull_aggs); in qfq_update_agg()
293 agg->budgetmax = new_num_classes * agg->lmax; in qfq_update_agg()
294 new_agg_weight = agg->class_weight * new_num_classes; in qfq_update_agg()
295 agg->inv_w = ONE_FP/new_agg_weight; in qfq_update_agg()
297 if (agg->grp == NULL) { in qfq_update_agg()
298 int i = qfq_calc_index(agg->inv_w, agg->budgetmax, in qfq_update_agg()
300 agg->grp = &q->groups[i]; in qfq_update_agg()
304 (int) agg->class_weight * (new_num_classes - agg->num_classes); in qfq_update_agg()
307 agg->num_classes = new_num_classes; in qfq_update_agg()
312 struct qfq_aggregate *agg, in qfq_add_to_agg() argument
315 cl->agg = agg; in qfq_add_to_agg()
317 qfq_update_agg(q, agg, agg->num_classes+1); in qfq_add_to_agg()
319 list_add_tail(&cl->alist, &agg->active); in qfq_add_to_agg()
320 if (list_first_entry(&agg->active, struct qfq_class, alist) == in qfq_add_to_agg()
321 cl && q->in_serv_agg != agg) /* agg was inactive */ in qfq_add_to_agg()
322 qfq_activate_agg(q, agg, enqueue); /* schedule agg */ in qfq_add_to_agg()
328 static void qfq_destroy_agg(struct qfq_sched *q, struct qfq_aggregate *agg) in qfq_destroy_agg() argument
330 hlist_del_init(&agg->nonfull_next); in qfq_destroy_agg()
331 q->wsum -= agg->class_weight; in qfq_destroy_agg()
335 if (q->in_serv_agg == agg) in qfq_destroy_agg()
337 kfree(agg); in qfq_destroy_agg()
343 struct qfq_aggregate *agg = cl->agg; in qfq_deactivate_class() local
347 if (list_empty(&agg->active)) /* agg is now inactive */ in qfq_deactivate_class()
348 qfq_deactivate_agg(q, agg); in qfq_deactivate_class()
354 struct qfq_aggregate *agg = cl->agg; in qfq_rm_from_agg() local
356 cl->agg = NULL; in qfq_rm_from_agg()
357 if (agg->num_classes == 1) { /* agg being emptied, destroy it */ in qfq_rm_from_agg()
358 qfq_destroy_agg(q, agg); in qfq_rm_from_agg()
361 qfq_update_agg(q, agg, agg->num_classes-1); in qfq_rm_from_agg()
438 lmax == cl->agg->lmax && in qfq_change_class()
439 weight == cl->agg->class_weight) in qfq_change_class()
442 delta_w = weight - (cl ? cl->agg->class_weight : 0); in qfq_change_class()
621 if (nla_put_u32(skb, TCA_QFQ_WEIGHT, cl->agg->class_weight) || in qfq_dump_class()
622 nla_put_u32(skb, TCA_QFQ_LMAX, cl->agg->lmax)) in qfq_dump_class()
639 xstats.weight = cl->agg->class_weight; in qfq_dump_class_stats()
640 xstats.lmax = cl->agg->lmax; in qfq_dump_class_stats()
875 static void qfq_slot_insert(struct qfq_group *grp, struct qfq_aggregate *agg, in qfq_slot_insert() argument
884 agg->S -= deltaS; in qfq_slot_insert()
885 agg->F -= deltaS; in qfq_slot_insert()
891 hlist_add_head(&agg->next, &grp->slots[i]); in qfq_slot_insert()
907 struct qfq_aggregate *agg = qfq_slot_head(grp); in qfq_front_slot_remove() local
909 BUG_ON(!agg); in qfq_front_slot_remove()
910 hlist_del(&agg->next); in qfq_front_slot_remove()
973 static void agg_dequeue(struct qfq_aggregate *agg, in agg_dequeue() argument
983 cl->deficit += agg->lmax; in agg_dequeue()
984 list_move_tail(&cl->alist, &agg->active); in agg_dequeue()
988 static inline struct sk_buff *qfq_peek_skb(struct qfq_aggregate *agg, in qfq_peek_skb() argument
994 *cl = list_first_entry(&agg->active, struct qfq_class, alist); in qfq_peek_skb()
1005 static inline void charge_actual_service(struct qfq_aggregate *agg) in charge_actual_service() argument
1012 u32 service_received = min(agg->budgetmax, in charge_actual_service()
1013 agg->initial_budget - agg->budget); in charge_actual_service()
1015 agg->F = agg->S + (u64)service_received * agg->inv_w; in charge_actual_service()
1030 static void qfq_update_start(struct qfq_sched *q, struct qfq_aggregate *agg) in qfq_update_start() argument
1034 int slot_shift = agg->grp->slot_shift; in qfq_update_start()
1036 roundedF = qfq_round_down(agg->F, slot_shift); in qfq_update_start()
1039 if (!qfq_gt(agg->F, q->V) || qfq_gt(roundedF, limit)) { in qfq_update_start()
1041 mask = mask_from(q->bitmaps[ER], agg->grp->index); in qfq_update_start()
1046 agg->S = next->F; in qfq_update_start()
1048 agg->S = limit; in qfq_update_start()
1052 agg->S = q->V; in qfq_update_start()
1054 agg->S = agg->F; in qfq_update_start()
1064 struct qfq_aggregate *agg, enum update_reason reason) in qfq_update_agg_ts() argument
1067 qfq_update_start(q, agg); in qfq_update_agg_ts()
1069 agg->S = agg->F; in qfq_update_agg_ts()
1071 agg->F = agg->S + (u64)agg->budgetmax * agg->inv_w; in qfq_update_agg_ts()
1074 static void qfq_schedule_agg(struct qfq_sched *q, struct qfq_aggregate *agg);
1156 struct qfq_aggregate *agg, *new_front_agg; in qfq_choose_next_agg() local
1168 agg = qfq_slot_head(grp); in qfq_choose_next_agg()
1183 return agg; in qfq_choose_next_agg()
1193 return agg; in qfq_choose_next_agg()
1202 struct qfq_aggregate *agg; in qfq_enqueue() local
1215 if (unlikely(cl->agg->lmax < len)) { in qfq_enqueue()
1217 cl->agg->lmax, len, cl->common.classid); in qfq_enqueue()
1218 err = qfq_change_agg(sch, cl, cl->agg->class_weight, len); in qfq_enqueue()
1242 agg = cl->agg; in qfq_enqueue()
1246 list_first_entry(&agg->active, struct qfq_class, alist) in qfq_enqueue()
1248 list_move_tail(&cl->alist, &agg->active); in qfq_enqueue()
1254 cl->deficit = agg->lmax; in qfq_enqueue()
1255 list_add_tail(&cl->alist, &agg->active); in qfq_enqueue()
1257 if (list_first_entry(&agg->active, struct qfq_class, alist) != cl || in qfq_enqueue()
1258 q->in_serv_agg == agg) in qfq_enqueue()
1261 qfq_activate_agg(q, agg, enqueue); in qfq_enqueue()
1269 static void qfq_schedule_agg(struct qfq_sched *q, struct qfq_aggregate *agg) in qfq_schedule_agg() argument
1271 struct qfq_group *grp = agg->grp; in qfq_schedule_agg()
1275 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_schedule_agg()
1287 if (!qfq_gt(grp->S, agg->S)) in qfq_schedule_agg()
1306 (unsigned long long) agg->S, in qfq_schedule_agg()
1307 (unsigned long long) agg->F, in qfq_schedule_agg()
1311 qfq_slot_insert(grp, agg, roundedS); in qfq_schedule_agg()
1316 static void qfq_activate_agg(struct qfq_sched *q, struct qfq_aggregate *agg, in qfq_activate_agg() argument
1319 agg->initial_budget = agg->budget = agg->budgetmax; /* recharge budg. */ in qfq_activate_agg()
1321 qfq_update_agg_ts(q, agg, reason); in qfq_activate_agg()
1323 q->in_serv_agg = agg; /* start serving this aggregate */ in qfq_activate_agg()
1325 q->oldV = q->V = agg->S; in qfq_activate_agg()
1326 } else if (agg != q->in_serv_agg) in qfq_activate_agg()
1327 qfq_schedule_agg(q, agg); in qfq_activate_agg()
1331 struct qfq_aggregate *agg) in qfq_slot_remove() argument
1336 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_slot_remove()
1341 hlist_del(&agg->next); in qfq_slot_remove()
1353 static void qfq_deactivate_agg(struct qfq_sched *q, struct qfq_aggregate *agg) in qfq_deactivate_agg() argument
1355 struct qfq_group *grp = agg->grp; in qfq_deactivate_agg()
1360 if (agg == q->in_serv_agg) { in qfq_deactivate_agg()
1361 charge_actual_service(agg); in qfq_deactivate_agg()
1366 agg->F = agg->S; in qfq_deactivate_agg()
1367 qfq_slot_remove(q, grp, agg); in qfq_deactivate_agg()
1386 agg = qfq_slot_scan(grp); in qfq_deactivate_agg()
1387 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_deactivate_agg()