• Home
  • Raw
  • Download

Lines Matching refs:htb

55 	struct rtnl_htb_qdisc *htb = data;  in htb_qdisc_msg_parser()  local
65 htb->qh_rate2quantum = opts.rate2quantum; in htb_qdisc_msg_parser()
66 htb->qh_defcls = opts.defcls; in htb_qdisc_msg_parser()
67 htb->qh_direct_pkts = opts.direct_pkts; in htb_qdisc_msg_parser()
69 htb->qh_mask = (SCH_HTB_HAS_RATE2QUANTUM | SCH_HTB_HAS_DEFCLS); in htb_qdisc_msg_parser()
78 struct rtnl_htb_class *htb = data; in htb_class_msg_parser() local
88 htb->ch_prio = opts.prio; in htb_class_msg_parser()
89 rtnl_copy_ratespec(&htb->ch_rate, &opts.rate); in htb_class_msg_parser()
90 rtnl_copy_ratespec(&htb->ch_ceil, &opts.ceil); in htb_class_msg_parser()
93 nla_memcpy(&htb->ch_rate.rs_rate64, tb[TCA_HTB_RATE64], sizeof(uint64_t)); in htb_class_msg_parser()
95 nla_memcpy(&htb->ch_ceil.rs_rate64, tb[TCA_HTB_CEIL64], sizeof(uint64_t)); in htb_class_msg_parser()
97 htb->ch_rbuffer = rtnl_tc_calc_bufsize64(nl_ticks2us(opts.buffer), in htb_class_msg_parser()
98 htb->ch_rate.rs_rate64); in htb_class_msg_parser()
99 htb->ch_cbuffer = rtnl_tc_calc_bufsize64(nl_ticks2us(opts.cbuffer), in htb_class_msg_parser()
100 htb->ch_ceil.rs_rate64); in htb_class_msg_parser()
101 htb->ch_quantum = opts.quantum; in htb_class_msg_parser()
102 htb->ch_level = opts.level; in htb_class_msg_parser()
104 rtnl_tc_set_mpu(tc, htb->ch_rate.rs_mpu); in htb_class_msg_parser()
105 rtnl_tc_set_overhead(tc, htb->ch_rate.rs_overhead); in htb_class_msg_parser()
107 htb->ch_mask = (SCH_HTB_HAS_PRIO | SCH_HTB_HAS_RATE | in htb_class_msg_parser()
119 struct rtnl_htb_qdisc *htb = data; in htb_qdisc_dump_line() local
121 if (!htb) in htb_qdisc_dump_line()
124 if (htb->qh_mask & SCH_HTB_HAS_RATE2QUANTUM) in htb_qdisc_dump_line()
125 nl_dump(p, " r2q %u", htb->qh_rate2quantum); in htb_qdisc_dump_line()
127 if (htb->qh_mask & SCH_HTB_HAS_DEFCLS) { in htb_qdisc_dump_line()
130 rtnl_tc_handle2str(htb->qh_defcls, buf, sizeof(buf))); in htb_qdisc_dump_line()
137 struct rtnl_htb_class *htb = data; in htb_class_dump_line() local
139 if (!htb) in htb_class_dump_line()
142 if (htb->ch_mask & SCH_HTB_HAS_RATE) { in htb_class_dump_line()
146 r = nl_cancel_down_bytes(htb->ch_rate.rs_rate64, &ru); in htb_class_dump_line()
147 rbit = nl_cancel_down_bits(htb->ch_rate.rs_rate64*8, &rubit); in htb_class_dump_line()
150 r, ru, rbit, rubit, 1<<htb->ch_rate.rs_cell_log); in htb_class_dump_line()
157 struct rtnl_htb_class *htb = data; in htb_class_dump_details() local
159 if (!htb) in htb_class_dump_details()
163 if (htb->ch_mask & SCH_HTB_HAS_CEIL) { in htb_class_dump_details()
167 r = nl_cancel_down_bytes(htb->ch_ceil.rs_rate64, &ru); in htb_class_dump_details()
168 rbit = nl_cancel_down_bits(htb->ch_ceil.rs_rate64*8, &rubit); in htb_class_dump_details()
171 r, ru, rbit, rubit, 1<<htb->ch_ceil.rs_cell_log); in htb_class_dump_details()
174 if (htb->ch_mask & SCH_HTB_HAS_PRIO) in htb_class_dump_details()
175 nl_dump(p, " prio %u", htb->ch_prio); in htb_class_dump_details()
177 if (htb->ch_mask & SCH_HTB_HAS_RBUFFER) { in htb_class_dump_details()
181 b = nl_cancel_down_bytes(htb->ch_rbuffer, &bu); in htb_class_dump_details()
185 if (htb->ch_mask & SCH_HTB_HAS_CBUFFER) { in htb_class_dump_details()
189 b = nl_cancel_down_bytes(htb->ch_cbuffer, &bu); in htb_class_dump_details()
193 if (htb->ch_mask & SCH_HTB_HAS_QUANTUM) in htb_class_dump_details()
194 nl_dump(p, " quantum %u", htb->ch_quantum); in htb_class_dump_details()
200 struct rtnl_htb_qdisc *htb = data; in htb_qdisc_msg_fill() local
206 if (htb) { in htb_qdisc_msg_fill()
207 if (htb->qh_mask & SCH_HTB_HAS_RATE2QUANTUM) in htb_qdisc_msg_fill()
208 opts.rate2quantum = htb->qh_rate2quantum; in htb_qdisc_msg_fill()
210 if (htb->qh_mask & SCH_HTB_HAS_DEFCLS) in htb_qdisc_msg_fill()
211 opts.defcls = htb->qh_defcls; in htb_qdisc_msg_fill()
220 struct rtnl_htb_class *htb = data; in htb_class_msg_fill() local
227 if (!htb || !(htb->ch_mask & SCH_HTB_HAS_RATE)) in htb_class_msg_fill()
233 if (htb->ch_mask & SCH_HTB_HAS_PRIO) in htb_class_msg_fill()
234 opts.prio = htb->ch_prio; in htb_class_msg_fill()
238 rtnl_tc_build_rate_table(tc, &htb->ch_rate, rtable); in htb_class_msg_fill()
239 rtnl_rcopy_ratespec(&opts.rate, &htb->ch_rate); in htb_class_msg_fill()
240 rate64 = htb->ch_rate.rs_rate64; in htb_class_msg_fill()
242 if (htb->ch_mask & SCH_HTB_HAS_CEIL) { in htb_class_msg_fill()
243 rtnl_tc_build_rate_table(tc, &htb->ch_ceil, ctable); in htb_class_msg_fill()
244 rtnl_rcopy_ratespec(&opts.ceil, &htb->ch_ceil); in htb_class_msg_fill()
245 ceil64 = htb->ch_ceil.rs_rate64; in htb_class_msg_fill()
255 if (htb->ch_mask & SCH_HTB_HAS_RBUFFER) in htb_class_msg_fill()
256 buffer = htb->ch_rbuffer; in htb_class_msg_fill()
262 if (htb->ch_mask & SCH_HTB_HAS_CBUFFER) in htb_class_msg_fill()
263 cbuffer = htb->ch_cbuffer; in htb_class_msg_fill()
269 if (htb->ch_mask & SCH_HTB_HAS_QUANTUM) in htb_class_msg_fill()
270 opts.quantum = htb->ch_quantum; in htb_class_msg_fill()
312 struct rtnl_htb_qdisc *htb; in rtnl_htb_get_rate2quantum() local
314 if ((htb = htb_qdisc_data(qdisc, NULL)) && in rtnl_htb_get_rate2quantum()
315 (htb->qh_mask & SCH_HTB_HAS_RATE2QUANTUM)) in rtnl_htb_get_rate2quantum()
316 return htb->qh_rate2quantum; in rtnl_htb_get_rate2quantum()
323 struct rtnl_htb_qdisc *htb; in rtnl_htb_set_rate2quantum() local
326 if (!(htb = htb_qdisc_data(qdisc, &err))) in rtnl_htb_set_rate2quantum()
329 htb->qh_rate2quantum = rate2quantum; in rtnl_htb_set_rate2quantum()
330 htb->qh_mask |= SCH_HTB_HAS_RATE2QUANTUM; in rtnl_htb_set_rate2quantum()
346 struct rtnl_htb_qdisc *htb; in rtnl_htb_get_defcls() local
348 if ((htb = htb_qdisc_data(qdisc, NULL)) && in rtnl_htb_get_defcls()
349 htb->qh_mask & SCH_HTB_HAS_DEFCLS) in rtnl_htb_get_defcls()
350 return htb->qh_defcls; in rtnl_htb_get_defcls()
362 struct rtnl_htb_qdisc *htb; in rtnl_htb_set_defcls() local
365 if (!(htb = htb_qdisc_data(qdisc, &err))) in rtnl_htb_set_defcls()
368 htb->qh_defcls = defcls; in rtnl_htb_set_defcls()
369 htb->qh_mask |= SCH_HTB_HAS_DEFCLS; in rtnl_htb_set_defcls()
376 struct rtnl_htb_class *htb; in rtnl_htb_get_prio() local
378 if ((htb = htb_class_data(class, NULL)) && in rtnl_htb_get_prio()
379 (htb->ch_mask & SCH_HTB_HAS_PRIO)) in rtnl_htb_get_prio()
380 return htb->ch_prio; in rtnl_htb_get_prio()
387 struct rtnl_htb_class *htb; in rtnl_htb_set_prio() local
390 if (!(htb = htb_class_data(class, &err))) in rtnl_htb_set_prio()
393 htb->ch_prio = prio; in rtnl_htb_set_prio()
394 htb->ch_mask |= SCH_HTB_HAS_PRIO; in rtnl_htb_set_prio()
409 struct rtnl_htb_class *htb; in rtnl_htb_get_rate() local
411 if ( !(htb = htb_class_data(class, NULL)) in rtnl_htb_get_rate()
412 || !(htb->ch_mask & SCH_HTB_HAS_RATE)) in rtnl_htb_get_rate()
415 if (htb->ch_rate.rs_rate64 > 0xFFFFFFFFull) in rtnl_htb_get_rate()
418 return htb->ch_rate.rs_rate64; in rtnl_htb_get_rate()
430 struct rtnl_htb_class *htb; in rtnl_htb_get_rate64() local
432 if (!(htb = htb_class_data(class, NULL))) in rtnl_htb_get_rate64()
434 if (!(htb->ch_mask & SCH_HTB_HAS_RATE)) in rtnl_htb_get_rate64()
437 *out_rate64 = htb->ch_rate.rs_rate64; in rtnl_htb_get_rate64()
462 struct rtnl_htb_class *htb; in rtnl_htb_set_rate64() local
465 if (!(htb = htb_class_data(class, &err))) in rtnl_htb_set_rate64()
468 htb->ch_rate.rs_cell_log = UINT8_MAX; /* use default value */ in rtnl_htb_set_rate64()
469 htb->ch_rate.rs_rate64 = rate; in rtnl_htb_set_rate64()
470 htb->ch_mask |= SCH_HTB_HAS_RATE; in rtnl_htb_set_rate64()
485 struct rtnl_htb_class *htb; in rtnl_htb_get_ceil() local
487 if ( !(htb = htb_class_data(class, NULL)) in rtnl_htb_get_ceil()
488 || !(htb->ch_mask & SCH_HTB_HAS_CEIL)) in rtnl_htb_get_ceil()
491 if (htb->ch_ceil.rs_rate64 > 0xFFFFFFFFull) in rtnl_htb_get_ceil()
494 return htb->ch_ceil.rs_rate64; in rtnl_htb_get_ceil()
506 struct rtnl_htb_class *htb; in rtnl_htb_get_ceil64() local
508 if (!(htb = htb_class_data(class, NULL))) in rtnl_htb_get_ceil64()
510 if (!(htb->ch_mask & SCH_HTB_HAS_CEIL)) in rtnl_htb_get_ceil64()
513 *out_ceil64 = htb->ch_ceil.rs_rate64; in rtnl_htb_get_ceil64()
538 struct rtnl_htb_class *htb; in rtnl_htb_set_ceil64() local
541 if (!(htb = htb_class_data(class, &err))) in rtnl_htb_set_ceil64()
544 htb->ch_ceil.rs_cell_log = UINT8_MAX; /* use default value */ in rtnl_htb_set_ceil64()
545 htb->ch_ceil.rs_rate64 = ceil64; in rtnl_htb_set_ceil64()
546 htb->ch_mask |= SCH_HTB_HAS_CEIL; in rtnl_htb_set_ceil64()
559 struct rtnl_htb_class *htb; in rtnl_htb_get_rbuffer() local
561 if ((htb = htb_class_data(class, NULL)) && in rtnl_htb_get_rbuffer()
562 htb->ch_mask & SCH_HTB_HAS_RBUFFER) in rtnl_htb_get_rbuffer()
563 return htb->ch_rbuffer; in rtnl_htb_get_rbuffer()
575 struct rtnl_htb_class *htb; in rtnl_htb_set_rbuffer() local
578 if (!(htb = htb_class_data(class, &err))) in rtnl_htb_set_rbuffer()
581 htb->ch_rbuffer = rbuffer; in rtnl_htb_set_rbuffer()
582 htb->ch_mask |= SCH_HTB_HAS_RBUFFER; in rtnl_htb_set_rbuffer()
595 struct rtnl_htb_class *htb; in rtnl_htb_get_cbuffer() local
597 if ((htb = htb_class_data(class, NULL)) && in rtnl_htb_get_cbuffer()
598 htb->ch_mask & SCH_HTB_HAS_CBUFFER) in rtnl_htb_get_cbuffer()
599 return htb->ch_cbuffer; in rtnl_htb_get_cbuffer()
611 struct rtnl_htb_class *htb; in rtnl_htb_set_cbuffer() local
614 if (!(htb = htb_class_data(class, &err))) in rtnl_htb_set_cbuffer()
617 htb->ch_cbuffer = cbuffer; in rtnl_htb_set_cbuffer()
618 htb->ch_mask |= SCH_HTB_HAS_CBUFFER; in rtnl_htb_set_cbuffer()
633 struct rtnl_htb_class *htb; in rtnl_htb_get_quantum() local
635 if ((htb = htb_class_data(class, NULL)) && in rtnl_htb_get_quantum()
636 htb->ch_mask & SCH_HTB_HAS_QUANTUM) in rtnl_htb_get_quantum()
637 return htb->ch_quantum; in rtnl_htb_get_quantum()
653 struct rtnl_htb_class *htb; in rtnl_htb_set_quantum() local
656 if (!(htb = htb_class_data(class, &err))) in rtnl_htb_set_quantum()
659 htb->ch_quantum = quantum; in rtnl_htb_set_quantum()
660 htb->ch_mask |= SCH_HTB_HAS_QUANTUM; in rtnl_htb_set_quantum()
677 struct rtnl_htb_class *htb; in rtnl_htb_get_level() local
680 if ((htb = htb_class_data(class, &err)) && in rtnl_htb_get_level()
681 (htb->ch_mask & SCH_HTB_HAS_LEVEL)) in rtnl_htb_get_level()
682 return htb->ch_level; in rtnl_htb_get_level()
701 struct rtnl_htb_class *htb; in rtnl_htb_set_level() local
704 if (!(htb = htb_class_data(class, &err))) in rtnl_htb_set_level()
707 htb->ch_level = level; in rtnl_htb_set_level()
708 htb->ch_mask |= SCH_HTB_HAS_LEVEL; in rtnl_htb_set_level()