Lines Matching refs:avg
192 to->avg = cfg->avg; in cfg_copy()
438 if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_parse()
462 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
464 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
471 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
473 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 1)) in hashlimit_mt_parse_v1()
503 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
505 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
512 if (parse_bytes(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
514 else if (!parse_rate(cb->arg, &info->cfg.avg, cb->udata, 2)) in hashlimit_mt_parse()
558 if (info->cfg.burst < cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check_v1()
560 "burst cannot be smaller than %lub", cost_to_bytes(info->cfg.avg)); in hashlimit_mt_check_v1()
563 burst /= cost_to_bytes(info->cfg.avg); in hashlimit_mt_check_v1()
564 if (info->cfg.burst % cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check_v1()
588 if (info->cfg.burst < cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check()
590 "burst cannot be smaller than %lub", cost_to_bytes(info->cfg.avg)); in hashlimit_mt_check()
593 burst /= cost_to_bytes(info->cfg.avg); in hashlimit_mt_check()
594 if (info->cfg.burst % cost_to_bytes(info->cfg.avg)) in hashlimit_mt_check()
648 static uint32_t print_bytes(uint64_t avg, uint64_t burst, const char *prefix) in print_bytes() argument
653 r = cost_to_bytes(avg); in print_bytes()
657 bytes_to_cost(r & ~(units[i].thresh - 1)) == avg) in print_bytes()
709 quantum = print_rate(r->cfg.avg, 1); in hashlimit_print()
734 quantum = print_bytes(cfg->avg, cfg->burst, ""); in hashlimit_mt_print()
736 quantum = print_rate(cfg->avg, revision); in hashlimit_mt_print()
815 quantum = print_rate(r->cfg.avg, 1); in hashlimit_save()
844 quantum = print_bytes(cfg->avg, cfg->burst, "--hashlimit-"); in hashlimit_mt_save()
846 quantum = print_rate(cfg->avg, revision); in hashlimit_mt_save()