Lines Matching refs:bucket
345 static struct sk_buff *dequeue_head(struct wdrr_bucket *bucket) in dequeue_head() argument
347 struct sk_buff *skb = bucket->head; in dequeue_head()
349 bucket->head = skb->next; in dequeue_head()
355 static void bucket_add(struct wdrr_bucket *bucket, struct sk_buff *skb) in bucket_add() argument
357 if (bucket->head == NULL) in bucket_add()
358 bucket->head = skb; in bucket_add()
360 bucket->tail->next = skb; in bucket_add()
361 bucket->tail = skb; in bucket_add()
368 struct wdrr_bucket *bucket; in hhf_drop() local
371 bucket = &q->buckets[WDRR_BUCKET_FOR_HH]; in hhf_drop()
372 if (!bucket->head) in hhf_drop()
373 bucket = &q->buckets[WDRR_BUCKET_FOR_NON_HH]; in hhf_drop()
375 if (bucket->head) { in hhf_drop()
376 struct sk_buff *skb = dequeue_head(bucket); in hhf_drop()
385 return bucket - q->buckets; in hhf_drop()
392 struct wdrr_bucket *bucket; in hhf_enqueue() local
396 bucket = &q->buckets[idx]; in hhf_enqueue()
397 bucket_add(bucket, skb); in hhf_enqueue()
400 if (list_empty(&bucket->bucketchain)) { in hhf_enqueue()
410 list_add_tail(&bucket->bucketchain, &q->old_buckets); in hhf_enqueue()
413 list_add_tail(&bucket->bucketchain, &q->new_buckets); in hhf_enqueue()
415 bucket->deficit = weight * q->quantum; in hhf_enqueue()
436 struct wdrr_bucket *bucket; in hhf_dequeue() local
446 bucket = list_first_entry(head, struct wdrr_bucket, bucketchain); in hhf_dequeue()
448 if (bucket->deficit <= 0) { in hhf_dequeue()
449 int weight = (bucket - q->buckets == WDRR_BUCKET_FOR_HH) ? in hhf_dequeue()
452 bucket->deficit += weight * q->quantum; in hhf_dequeue()
453 list_move_tail(&bucket->bucketchain, &q->old_buckets); in hhf_dequeue()
457 if (bucket->head) { in hhf_dequeue()
458 skb = dequeue_head(bucket); in hhf_dequeue()
466 list_move_tail(&bucket->bucketchain, &q->old_buckets); in hhf_dequeue()
468 list_del_init(&bucket->bucketchain); in hhf_dequeue()
472 bucket->deficit -= qdisc_pkt_len(skb); in hhf_dequeue()
661 struct wdrr_bucket *bucket = q->buckets + i; in hhf_init() local
663 INIT_LIST_HEAD(&bucket->bucketchain); in hhf_init()