• Home
  • Raw
  • Download

Lines Matching refs:tbf

42 	struct rtnl_tbf *tbf = data;  in tbf_msg_parser()  local
53 tbf->qt_limit = opts.limit; in tbf_msg_parser()
55 rtnl_copy_ratespec(&tbf->qt_rate, &opts.rate); in tbf_msg_parser()
56 tbf->qt_rate_txtime = opts.buffer; in tbf_msg_parser()
58 tbf->qt_rate.rs_rate64); in tbf_msg_parser()
59 tbf->qt_rate_bucket = bufsize; in tbf_msg_parser()
61 rtnl_copy_ratespec(&tbf->qt_peakrate, &opts.peakrate); in tbf_msg_parser()
62 tbf->qt_peakrate_txtime = opts.mtu; in tbf_msg_parser()
64 tbf->qt_peakrate.rs_rate64); in tbf_msg_parser()
65 tbf->qt_peakrate_bucket = bufsize; in tbf_msg_parser()
67 rtnl_tc_set_mpu(tc, tbf->qt_rate.rs_mpu); in tbf_msg_parser()
68 rtnl_tc_set_overhead(tc, tbf->qt_rate.rs_overhead); in tbf_msg_parser()
70 tbf->qt_mask = (TBF_ATTR_LIMIT | TBF_ATTR_RATE | TBF_ATTR_PEAKRATE); in tbf_msg_parser()
81 struct rtnl_tbf *tbf = data; in tbf_dump_line() local
83 if (!tbf) in tbf_dump_line()
86 r = nl_cancel_down_bytes(tbf->qt_rate.rs_rate64, &ru); in tbf_dump_line()
87 rbit = nl_cancel_down_bits(tbf->qt_rate.rs_rate64*8, &rubit); in tbf_dump_line()
88 lim = nl_cancel_down_bytes(tbf->qt_limit, &limu); in tbf_dump_line()
97 struct rtnl_tbf *tbf = data; in tbf_dump_details() local
99 if (!tbf) in tbf_dump_details()
104 double bs = nl_cancel_down_bytes(tbf->qt_rate_bucket, &bu); in tbf_dump_details()
105 double cl = nl_cancel_down_bytes(1 << tbf->qt_rate.rs_cell_log, in tbf_dump_details()
114 if (tbf->qt_mask & TBF_ATTR_PEAKRATE) { in tbf_dump_details()
118 pr = nl_cancel_down_bytes(tbf->qt_peakrate.rs_rate64, &pru); in tbf_dump_details()
119 prb = nl_cancel_down_bits(tbf->qt_peakrate.rs_rate64 * 8, &prbu); in tbf_dump_details()
120 bs = nl_cancel_down_bits(tbf->qt_peakrate_bucket, &bsu); in tbf_dump_details()
121 cl = nl_cancel_down_bits(1 << tbf->qt_peakrate.rs_cell_log, in tbf_dump_details()
135 struct rtnl_tbf *tbf = data; in tbf_msg_fill() local
138 if ((tbf->qt_mask & required) != required) in tbf_msg_fill()
142 opts.limit = tbf->qt_limit; in tbf_msg_fill()
143 opts.buffer = tbf->qt_rate_txtime; in tbf_msg_fill()
145 rtnl_tc_build_rate_table(tc, &tbf->qt_rate, rtab); in tbf_msg_fill()
146 rtnl_rcopy_ratespec(&opts.rate, &tbf->qt_rate); in tbf_msg_fill()
148 if (tbf->qt_mask & TBF_ATTR_PEAKRATE) { in tbf_msg_fill()
149 opts.mtu = tbf->qt_peakrate_txtime; in tbf_msg_fill()
150 rtnl_tc_build_rate_table(tc, &tbf->qt_peakrate, ptab); in tbf_msg_fill()
151 rtnl_rcopy_ratespec(&opts.peakrate, &tbf->qt_peakrate); in tbf_msg_fill()
158 if (tbf->qt_mask & TBF_ATTR_PEAKRATE) in tbf_msg_fill()
180 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_set_limit() local
182 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_set_limit()
185 tbf->qt_limit = limit; in rtnl_qdisc_tbf_set_limit()
186 tbf->qt_mask |= TBF_ATTR_LIMIT; in rtnl_qdisc_tbf_set_limit()
220 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_set_limit_by_latency() local
223 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_set_limit_by_latency()
226 if (!(tbf->qt_mask & TBF_ATTR_RATE)) in rtnl_qdisc_tbf_set_limit_by_latency()
229 limit = calc_limit(&tbf->qt_rate, latency, tbf->qt_rate_bucket); in rtnl_qdisc_tbf_set_limit_by_latency()
231 if (tbf->qt_mask & TBF_ATTR_PEAKRATE) { in rtnl_qdisc_tbf_set_limit_by_latency()
232 limit2 = calc_limit(&tbf->qt_peakrate, latency, in rtnl_qdisc_tbf_set_limit_by_latency()
233 tbf->qt_peakrate_bucket); in rtnl_qdisc_tbf_set_limit_by_latency()
251 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_get_limit() local
253 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_get_limit()
256 if (tbf->qt_mask & TBF_ATTR_LIMIT) in rtnl_qdisc_tbf_get_limit()
257 return tbf->qt_limit; in rtnl_qdisc_tbf_get_limit()
279 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_set_rate() local
282 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_set_rate()
290 tbf->qt_rate.rs_rate64 = (uint32_t)rate; in rtnl_qdisc_tbf_set_rate()
291 tbf->qt_rate_bucket = bucket; in rtnl_qdisc_tbf_set_rate()
292 tbf->qt_rate.rs_cell_log = cell_log; in rtnl_qdisc_tbf_set_rate()
293 tbf->qt_rate_txtime = nl_us2ticks(rtnl_tc_calc_txtime64(bucket, tbf->qt_rate.rs_rate64)); in rtnl_qdisc_tbf_set_rate()
294 tbf->qt_mask |= TBF_ATTR_RATE; in rtnl_qdisc_tbf_set_rate()
304 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_get_rate() local
306 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_get_rate()
309 if (tbf->qt_mask & TBF_ATTR_RATE) in rtnl_qdisc_tbf_get_rate()
310 return tbf->qt_rate.rs_rate64; in rtnl_qdisc_tbf_get_rate()
322 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_get_rate_bucket() local
324 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_get_rate_bucket()
327 if (tbf->qt_mask & TBF_ATTR_RATE) in rtnl_qdisc_tbf_get_rate_bucket()
328 return tbf->qt_rate_bucket; in rtnl_qdisc_tbf_get_rate_bucket()
340 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_get_rate_cell() local
342 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_get_rate_cell()
345 if (tbf->qt_mask & TBF_ATTR_RATE) in rtnl_qdisc_tbf_get_rate_cell()
346 return (1 << tbf->qt_rate.rs_cell_log); in rtnl_qdisc_tbf_get_rate_cell()
362 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_set_peakrate() local
365 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_set_peakrate()
372 tbf->qt_peakrate.rs_rate64 = (uint32_t)rate; in rtnl_qdisc_tbf_set_peakrate()
373 tbf->qt_peakrate_bucket = bucket; in rtnl_qdisc_tbf_set_peakrate()
374 tbf->qt_peakrate.rs_cell_log = cell_log; in rtnl_qdisc_tbf_set_peakrate()
375 tbf->qt_peakrate_txtime = nl_us2ticks(rtnl_tc_calc_txtime64(bucket, tbf->qt_peakrate.rs_rate64)); in rtnl_qdisc_tbf_set_peakrate()
377 tbf->qt_mask |= TBF_ATTR_PEAKRATE; in rtnl_qdisc_tbf_set_peakrate()
389 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_get_peakrate() local
391 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_get_peakrate()
394 if (tbf->qt_mask & TBF_ATTR_PEAKRATE) in rtnl_qdisc_tbf_get_peakrate()
395 return tbf->qt_peakrate.rs_rate64; in rtnl_qdisc_tbf_get_peakrate()
407 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_get_peakrate_bucket() local
409 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_get_peakrate_bucket()
412 if (tbf->qt_mask & TBF_ATTR_PEAKRATE) in rtnl_qdisc_tbf_get_peakrate_bucket()
413 return tbf->qt_peakrate_bucket; in rtnl_qdisc_tbf_get_peakrate_bucket()
425 struct rtnl_tbf *tbf; in rtnl_qdisc_tbf_get_peakrate_cell() local
427 if (!(tbf = rtnl_tc_data(TC_CAST(qdisc)))) in rtnl_qdisc_tbf_get_peakrate_cell()
430 if (tbf->qt_mask & TBF_ATTR_PEAKRATE) in rtnl_qdisc_tbf_get_peakrate_cell()
431 return (1 << tbf->qt_peakrate.rs_cell_log); in rtnl_qdisc_tbf_get_peakrate_cell()