Lines Matching refs:q

181 				       struct hhf_sched_data *q)  in seek_list()  argument
190 u32 prev = flow->hit_timestamp + q->hhf_evict_timeout; in seek_list()
200 q->hh_flows_current_cnt--; in seek_list()
212 struct hhf_sched_data *q) in alloc_new_hh() argument
220 u32 prev = flow->hit_timestamp + q->hhf_evict_timeout; in alloc_new_hh()
227 if (q->hh_flows_current_cnt >= q->hh_flows_limit) { in alloc_new_hh()
228 q->hh_flows_overlimit++; in alloc_new_hh()
236 q->hh_flows_current_cnt++; in alloc_new_hh()
248 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_classify() local
258 prev = q->hhf_arrays_reset_timestamp + q->hhf_reset_timeout; in hhf_classify()
261 bitmap_zero(q->hhf_valid_bits[i], HHF_ARRAYS_LEN); in hhf_classify()
262 q->hhf_arrays_reset_timestamp = now; in hhf_classify()
266 hash = skb_get_hash_perturb(skb, q->perturbation); in hhf_classify()
270 flow = seek_list(hash, &q->hh_flows[flow_pos], q); in hhf_classify()
293 if (!test_bit(filter_pos[i], q->hhf_valid_bits[i])) { in hhf_classify()
294 q->hhf_arrays[i][filter_pos[i]] = 0; in hhf_classify()
295 __set_bit(filter_pos[i], q->hhf_valid_bits[i]); in hhf_classify()
298 val = q->hhf_arrays[i][filter_pos[i]] + pkt_len; in hhf_classify()
304 if (min_hhf_val > q->hhf_admit_bytes) { in hhf_classify()
306 flow = alloc_new_hh(&q->hh_flows[flow_pos], q); in hhf_classify()
311 q->hh_flows_total_cnt++; in hhf_classify()
321 if (q->hhf_arrays[i][filter_pos[i]] < min_hhf_val) in hhf_classify()
322 q->hhf_arrays[i][filter_pos[i]] = min_hhf_val; in hhf_classify()
350 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_drop() local
354 bucket = &q->buckets[WDRR_BUCKET_FOR_HH]; in hhf_drop()
356 bucket = &q->buckets[WDRR_BUCKET_FOR_NON_HH]; in hhf_drop()
361 sch->q.qlen--; in hhf_drop()
368 return bucket - q->buckets; in hhf_drop()
382 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_enqueue() local
389 bucket = &q->buckets[idx]; in hhf_enqueue()
403 list_add_tail(&bucket->bucketchain, &q->old_buckets); in hhf_enqueue()
405 weight = q->hhf_non_hh_weight; in hhf_enqueue()
406 list_add_tail(&bucket->bucketchain, &q->new_buckets); in hhf_enqueue()
408 bucket->deficit = weight * q->quantum; in hhf_enqueue()
410 if (++sch->q.qlen <= sch->limit) in hhf_enqueue()
414 q->drop_overlimit++; in hhf_enqueue()
428 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_dequeue() local
434 head = &q->new_buckets; in hhf_dequeue()
436 head = &q->old_buckets; in hhf_dequeue()
443 int weight = (bucket - q->buckets == WDRR_BUCKET_FOR_HH) ? in hhf_dequeue()
444 1 : q->hhf_non_hh_weight; in hhf_dequeue()
446 bucket->deficit += weight * q->quantum; in hhf_dequeue()
447 list_move_tail(&bucket->bucketchain, &q->old_buckets); in hhf_dequeue()
453 sch->q.qlen--; in hhf_dequeue()
459 if ((head == &q->new_buckets) && !list_empty(&q->old_buckets)) in hhf_dequeue()
460 list_move_tail(&bucket->bucketchain, &q->old_buckets); in hhf_dequeue()
497 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_destroy() local
500 hhf_free(q->hhf_arrays[i]); in hhf_destroy()
501 hhf_free(q->hhf_valid_bits[i]); in hhf_destroy()
506 struct list_head *head = &q->hh_flows[i]; in hhf_destroy()
515 hhf_free(q->hh_flows); in hhf_destroy()
530 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_change() local
535 u32 new_quantum = q->quantum; in hhf_change()
536 u32 new_hhf_non_hh_weight = q->hhf_non_hh_weight; in hhf_change()
560 q->quantum = new_quantum; in hhf_change()
561 q->hhf_non_hh_weight = new_hhf_non_hh_weight; in hhf_change()
564 q->hh_flows_limit = nla_get_u32(tb[TCA_HHF_HH_FLOWS_LIMIT]); in hhf_change()
569 q->hhf_reset_timeout = usecs_to_jiffies(us); in hhf_change()
573 q->hhf_admit_bytes = nla_get_u32(tb[TCA_HHF_ADMIT_BYTES]); in hhf_change()
578 q->hhf_evict_timeout = usecs_to_jiffies(us); in hhf_change()
581 qlen = sch->q.qlen; in hhf_change()
583 while (sch->q.qlen > sch->limit) { in hhf_change()
588 qdisc_tree_reduce_backlog(sch, qlen - sch->q.qlen, in hhf_change()
597 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_init() local
601 q->quantum = psched_mtu(qdisc_dev(sch)); in hhf_init()
602 q->perturbation = prandom_u32(); in hhf_init()
603 INIT_LIST_HEAD(&q->new_buckets); in hhf_init()
604 INIT_LIST_HEAD(&q->old_buckets); in hhf_init()
607 q->hhf_reset_timeout = HZ / 25; /* 40 ms */ in hhf_init()
608 q->hhf_admit_bytes = 131072; /* 128 KB */ in hhf_init()
609 q->hhf_evict_timeout = HZ; /* 1 sec */ in hhf_init()
610 q->hhf_non_hh_weight = 2; in hhf_init()
619 if (!q->hh_flows) { in hhf_init()
621 q->hh_flows = hhf_zalloc(HH_FLOWS_CNT * in hhf_init()
623 if (!q->hh_flows) in hhf_init()
626 INIT_LIST_HEAD(&q->hh_flows[i]); in hhf_init()
629 q->hh_flows_limit = 2 * HH_FLOWS_CNT; in hhf_init()
630 q->hh_flows_overlimit = 0; in hhf_init()
631 q->hh_flows_total_cnt = 0; in hhf_init()
632 q->hh_flows_current_cnt = 0; in hhf_init()
636 q->hhf_arrays[i] = hhf_zalloc(HHF_ARRAYS_LEN * in hhf_init()
638 if (!q->hhf_arrays[i]) { in hhf_init()
643 q->hhf_arrays_reset_timestamp = hhf_time_stamp(); in hhf_init()
647 q->hhf_valid_bits[i] = hhf_zalloc(HHF_ARRAYS_LEN / in hhf_init()
649 if (!q->hhf_valid_bits[i]) { in hhf_init()
657 struct wdrr_bucket *bucket = q->buckets + i; in hhf_init()
668 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_dump() local
676 nla_put_u32(skb, TCA_HHF_QUANTUM, q->quantum) || in hhf_dump()
677 nla_put_u32(skb, TCA_HHF_HH_FLOWS_LIMIT, q->hh_flows_limit) || in hhf_dump()
679 jiffies_to_usecs(q->hhf_reset_timeout)) || in hhf_dump()
680 nla_put_u32(skb, TCA_HHF_ADMIT_BYTES, q->hhf_admit_bytes) || in hhf_dump()
682 jiffies_to_usecs(q->hhf_evict_timeout)) || in hhf_dump()
683 nla_put_u32(skb, TCA_HHF_NON_HH_WEIGHT, q->hhf_non_hh_weight)) in hhf_dump()
694 struct hhf_sched_data *q = qdisc_priv(sch); in hhf_dump_stats() local
696 .drop_overlimit = q->drop_overlimit, in hhf_dump_stats()
697 .hh_overlimit = q->hh_flows_overlimit, in hhf_dump_stats()
698 .hh_tot_count = q->hh_flows_total_cnt, in hhf_dump_stats()
699 .hh_cur_count = q->hh_flows_current_cnt, in hhf_dump_stats()