Lines Matching full:avg
45 "--hashlimit <avg> max average match rate\n" in hashlimit_help()
85 " --hashlimit-upto <avg> max average match rate\n" in hashlimit_mt_help()
88 " --hashlimit-above <avg> min average match rate\n" in hashlimit_mt_help()
106 " --hashlimit-upto <avg> max average match rate\n" in hashlimit_mt_help_v3()
109 " --hashlimit-above <avg> min average match rate\n" in hashlimit_mt_help_v3()
251 to->avg = cfg->avg; in cfg_copy()
263 to->avg = cfg->avg; in cfg_copy()
540 if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_parse()
564 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
566 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
573 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
575 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
605 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse_v2()
607 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse_v2()
614 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse_v2()
616 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse_v2()
646 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
648 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
655 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
657 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
708 if (info->cfg.burst < cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check_v1()
711 cost_to_bytes(info->cfg.avg)); in hashlimit_mt_check_v1()
714 burst /= cost_to_bytes(info->cfg.avg); in hashlimit_mt_check_v1()
715 if (info->cfg.burst % cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check_v1()
739 if (info->cfg.burst < cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check_v2()
742 cost_to_bytes(info->cfg.avg)); in hashlimit_mt_check_v2()
745 burst /= cost_to_bytes(info->cfg.avg); in hashlimit_mt_check_v2()
746 if (info->cfg.burst % cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check_v2()
770 if (info->cfg.burst < cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check()
772 "burst cannot be smaller than %"PRIu64"b", cost_to_bytes(info->cfg.avg)); in hashlimit_mt_check()
775 burst /= cost_to_bytes(info->cfg.avg); in hashlimit_mt_check()
776 if (info->cfg.burst % cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check()
787 info->cfg.avg /= udata->mult; in hashlimit_mt_check()
842 static uint32_t print_bytes(uint64_t avg, uint64_t burst, const char *prefix) in print_bytes() argument
847 r = cost_to_bytes(avg); in print_bytes()
851 bytes_to_cost(r & ~(units[i].thresh - 1)) == avg) in print_bytes()
902 fputs(" limit: avg", stdout); in hashlimit_print()
903 quantum = print_rate(r->cfg.avg, 1); in hashlimit_print()
929 quantum = print_bytes(cfg->avg, cfg->burst, ""); in hashlimit_mt_print()
932 period = cfg->avg; in hashlimit_mt_print()
938 quantum = print_rate(cfg->avg, revision); in hashlimit_mt_print()
1056 quantum = print_rate(r->cfg.avg, 1); in hashlimit_save()
1085 quantum = print_bytes(cfg->avg, cfg->burst, "--hashlimit-"); in hashlimit_mt_save()
1087 quantum = print_rate(cfg->avg, revision); in hashlimit_mt_save()
1209 static void print_packets_rate_xlate(struct xt_xlate *xl, uint64_t avg, in print_packets_rate_xlate() argument
1217 if (avg > _rates[i].mult || in print_packets_rate_xlate()
1218 _rates[i].mult / avg < _rates[i].mult % avg) in print_packets_rate_xlate()
1222 _rates[i-1].mult / avg, _rates[i-1].name); in print_packets_rate_xlate()
1231 r = cost_to_bytes(cfg->avg); in print_bytes_rate_xlate()
1235 bytes_to_cost(r & ~(units[i].thresh - 1)) == cfg->avg) in print_bytes_rate_xlate()
1352 print_packets_rate_xlate(xl, cfg->avg, revision); in hashlimit_mt_xlate()
1371 print_packets_rate_xlate(xl, info->cfg.avg, 1); in hashlimit_xlate()