Lines Matching full:table
61 static inline int gred_wred_mode(struct gred_sched *table) in gred_wred_mode() argument
63 return test_bit(GRED_WRED_MODE, &table->flags); in gred_wred_mode()
66 static inline void gred_enable_wred_mode(struct gred_sched *table) in gred_enable_wred_mode() argument
68 __set_bit(GRED_WRED_MODE, &table->flags); in gred_enable_wred_mode()
71 static inline void gred_disable_wred_mode(struct gred_sched *table) in gred_disable_wred_mode() argument
73 __clear_bit(GRED_WRED_MODE, &table->flags); in gred_disable_wred_mode()
76 static inline int gred_rio_mode(struct gred_sched *table) in gred_rio_mode() argument
78 return test_bit(GRED_RIO_MODE, &table->flags); in gred_rio_mode()
81 static inline void gred_enable_rio_mode(struct gred_sched *table) in gred_enable_rio_mode() argument
83 __set_bit(GRED_RIO_MODE, &table->flags); in gred_enable_rio_mode()
86 static inline void gred_disable_rio_mode(struct gred_sched *table) in gred_disable_rio_mode() argument
88 __clear_bit(GRED_RIO_MODE, &table->flags); in gred_disable_rio_mode()
93 struct gred_sched *table = qdisc_priv(sch); in gred_wred_mode_check() local
97 for (i = 0; i < table->DPs; i++) { in gred_wred_mode_check()
98 struct gred_sched_data *q = table->tab[i]; in gred_wred_mode_check()
104 for (n = i + 1; n < table->DPs; n++) in gred_wred_mode_check()
105 if (table->tab[n] && table->tab[n]->prio == q->prio) in gred_wred_mode_check()
112 static inline unsigned int gred_backlog(struct gred_sched *table, in gred_backlog() argument
116 if (gred_wred_mode(table)) in gred_backlog()
127 static inline void gred_load_wred_set(const struct gred_sched *table, in gred_load_wred_set() argument
130 q->vars.qavg = table->wred_set.qavg; in gred_load_wred_set()
131 q->vars.qidlestart = table->wred_set.qidlestart; in gred_load_wred_set()
134 static inline void gred_store_wred_set(struct gred_sched *table, in gred_store_wred_set() argument
137 table->wred_set.qavg = q->vars.qavg; in gred_store_wred_set()
138 table->wred_set.qidlestart = q->vars.qidlestart; in gred_store_wred_set()
151 static bool gred_per_vq_red_flags_used(struct gred_sched *table) in gred_per_vq_red_flags_used() argument
156 if (table->red_flags) in gred_per_vq_red_flags_used()
159 if (table->tab[i] && table->tab[i]->red_flags) in gred_per_vq_red_flags_used()
312 struct gred_sched *table = qdisc_priv(sch); in gred_offload() local
326 opt.set.grio_on = gred_rio_mode(table); in gred_offload()
327 opt.set.wred_on = gred_wred_mode(table); in gred_offload()
328 opt.set.dp_cnt = table->DPs; in gred_offload()
329 opt.set.dp_def = table->def; in gred_offload()
331 for (i = 0; i < table->DPs; i++) { in gred_offload()
332 struct gred_sched_data *q = table->tab[i]; in gred_offload()
354 struct gred_sched *table = qdisc_priv(sch); in gred_offload_dump_stats() local
368 if (table->tab[i]) in gred_offload_dump_stats()
369 hw_stats->stats.xstats[i] = &table->tab[i]->stats; in gred_offload_dump_stats()
376 if (!table->tab[i]) in gred_offload_dump_stats()
378 table->tab[i]->packetsin += hw_stats->stats.bstats[i].packets; in gred_offload_dump_stats()
379 table->tab[i]->bytesin += hw_stats->stats.bstats[i].bytes; in gred_offload_dump_stats()
380 table->tab[i]->backlog += hw_stats->stats.qstats[i].backlog; in gred_offload_dump_stats()
404 struct gred_sched *table = qdisc_priv(sch); in gred_change_table_def() local
427 if (sopt->flags && gred_per_vq_red_flags_used(table)) { in gred_change_table_def()
433 table->DPs = sopt->DPs; in gred_change_table_def()
434 table->def = sopt->def_DP; in gred_change_table_def()
435 red_flags_changed = table->red_flags != sopt->flags; in gred_change_table_def()
436 table->red_flags = sopt->flags; in gred_change_table_def()
446 gred_enable_rio_mode(table); in gred_change_table_def()
447 gred_disable_wred_mode(table); in gred_change_table_def()
449 gred_enable_wred_mode(table); in gred_change_table_def()
451 gred_disable_rio_mode(table); in gred_change_table_def()
452 gred_disable_wred_mode(table); in gred_change_table_def()
456 for (i = 0; i < table->DPs; i++) in gred_change_table_def()
457 if (table->tab[i]) in gred_change_table_def()
458 table->tab[i]->red_flags = in gred_change_table_def()
459 table->red_flags & GRED_VQ_RED_FLAGS; in gred_change_table_def()
461 for (i = table->DPs; i < MAX_DPs; i++) { in gred_change_table_def()
462 if (table->tab[i]) { in gred_change_table_def()
465 gred_destroy_vq(table->tab[i]); in gred_change_table_def()
466 table->tab[i] = NULL; in gred_change_table_def()
480 struct gred_sched *table = qdisc_priv(sch); in gred_change_vq() local
481 struct gred_sched_data *q = table->tab[dp]; in gred_change_vq()
489 table->tab[dp] = q = *prealloc; in gred_change_vq()
493 q->red_flags = table->red_flags & GRED_VQ_RED_FLAGS; in gred_change_vq()
531 static void gred_vq_apply(struct gred_sched *table, const struct nlattr *entry) in gred_vq_apply() argument
542 table->tab[dp]->red_flags = nla_get_u32(tb[TCA_GRED_VQ_FLAGS]); in gred_vq_apply()
545 static void gred_vqs_apply(struct gred_sched *table, struct nlattr *vqs) in gred_vqs_apply() argument
553 gred_vq_apply(table, attr); in gred_vqs_apply()
559 static int gred_vq_validate(struct gred_sched *table, u32 cdp, in gred_vq_validate() argument
577 if (dp >= table->DPs) { in gred_vq_validate()
581 if (dp != cdp && !table->tab[dp]) { in gred_vq_validate()
589 if (table->red_flags && table->red_flags != red_flags) { in gred_vq_validate()
603 static int gred_vqs_validate(struct gred_sched *table, u32 cdp, in gred_vqs_validate() argument
617 err = gred_vq_validate(table, cdp, attr, extack); in gred_vqs_validate()
638 struct gred_sched *table = qdisc_priv(sch); in gred_change() local
672 if (ctl->DP >= table->DPs) { in gred_change()
678 err = gred_vqs_validate(table, ctl->DP, tb[TCA_GRED_VQ_LIST], in gred_change()
684 if (gred_rio_mode(table)) { in gred_change()
688 if (table->tab[table->def]) in gred_change()
689 def_prio = table->tab[table->def]->prio; in gred_change()
708 gred_vqs_apply(table, tb[TCA_GRED_VQ_LIST]); in gred_change()
710 if (gred_rio_mode(table)) { in gred_change()
711 gred_disable_wred_mode(table); in gred_change()
713 gred_enable_wred_mode(table); in gred_change()
759 struct gred_sched *table = qdisc_priv(sch); in gred_dump() local
764 .DPs = table->DPs, in gred_dump()
765 .def_DP = table->def, in gred_dump()
766 .grio = gred_rio_mode(table), in gred_dump()
767 .flags = table->red_flags, in gred_dump()
780 struct gred_sched_data *q = table->tab[i]; in gred_dump()
796 struct gred_sched_data *q = table->tab[i]; in gred_dump()
813 opt.backlog = gred_backlog(table, q, sch); in gred_dump()
827 if (gred_wred_mode(table)) in gred_dump()
828 gred_load_wred_set(table, q); in gred_dump()
847 struct gred_sched_data *q = table->tab[i]; in gred_dump()
870 gred_backlog(table, q, sch))) in gred_dump()
902 struct gred_sched *table = qdisc_priv(sch); in gred_destroy() local
905 for (i = 0; i < table->DPs; i++) { in gred_destroy()
906 if (table->tab[i]) in gred_destroy()
907 gred_destroy_vq(table->tab[i]); in gred_destroy()