Lines Matching full:slot
104 sfq_index next; /* next slot in sfq RR chain */
107 short allot; /* credit for this slot */
121 u8 cur_depth; /* depth of longest slot */
131 struct sfq_slot *tail; /* current slot in round */
201 * x : slot number [0 .. SFQ_MAX_FLOWS - 1]
206 struct sfq_slot *slot = &q->slots[x]; in sfq_link() local
207 int qlen = slot->qlen; in sfq_link()
212 slot->dep.next = n; in sfq_link()
213 slot->dep.prev = p; in sfq_link()
256 /* remove one skb from tail of slot queue */
257 static inline struct sk_buff *slot_dequeue_tail(struct sfq_slot *slot) in slot_dequeue_tail() argument
259 struct sk_buff *skb = slot->skblist_prev; in slot_dequeue_tail()
261 slot->skblist_prev = skb->prev; in slot_dequeue_tail()
262 skb->prev->next = (struct sk_buff *)slot; in slot_dequeue_tail()
267 /* remove one skb from head of slot queue */
268 static inline struct sk_buff *slot_dequeue_head(struct sfq_slot *slot) in slot_dequeue_head() argument
270 struct sk_buff *skb = slot->skblist_next; in slot_dequeue_head()
272 slot->skblist_next = skb->next; in slot_dequeue_head()
273 skb->next->prev = (struct sk_buff *)slot; in slot_dequeue_head()
278 static inline void slot_queue_init(struct sfq_slot *slot) in slot_queue_init() argument
280 memset(slot, 0, sizeof(*slot)); in slot_queue_init()
281 slot->skblist_prev = slot->skblist_next = (struct sk_buff *)slot; in slot_queue_init()
284 /* add skb to slot queue (tail add) */
285 static inline void slot_queue_add(struct sfq_slot *slot, struct sk_buff *skb) in slot_queue_add() argument
287 skb->prev = slot->skblist_prev; in slot_queue_add()
288 skb->next = (struct sk_buff *)slot; in slot_queue_add()
289 slot->skblist_prev->next = skb; in slot_queue_add()
290 slot->skblist_prev = skb; in slot_queue_add()
299 struct sfq_slot *slot; in sfq_drop() local
301 /* Queue is full! Find the longest slot and drop tail packet from it */ in sfq_drop()
304 slot = &q->slots[x]; in sfq_drop()
306 skb = q->headdrop ? slot_dequeue_head(slot) : slot_dequeue_tail(slot); in sfq_drop()
308 slot->backlog -= len; in sfq_drop()
319 slot = &q->slots[x]; in sfq_drop()
320 q->tail->next = slot->next; in sfq_drop()
321 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_drop()
351 struct sfq_slot *slot; in sfq_enqueue() local
366 slot = &q->slots[x]; in sfq_enqueue()
368 x = q->dep[0].next; /* get a free slot */ in sfq_enqueue()
372 slot = &q->slots[x]; in sfq_enqueue()
373 slot->hash = hash; in sfq_enqueue()
374 slot->backlog = 0; /* should already be 0 anyway... */ in sfq_enqueue()
375 red_set_vars(&slot->vars); in sfq_enqueue()
379 slot->vars.qavg = red_calc_qavg_no_idle_time(q->red_parms, in sfq_enqueue()
380 &slot->vars, in sfq_enqueue()
381 slot->backlog); in sfq_enqueue()
383 &slot->vars, in sfq_enqueue()
384 slot->vars.qavg)) { in sfq_enqueue()
393 INET_ECN_set_ce(slot->skblist_next)) { in sfq_enqueue()
410 INET_ECN_set_ce(slot->skblist_next)) { in sfq_enqueue()
424 if (slot->qlen >= q->maxdepth) { in sfq_enqueue()
430 head = slot_dequeue_head(slot); in sfq_enqueue()
433 slot->backlog -= delta; in sfq_enqueue()
436 slot_queue_add(slot, skb); in sfq_enqueue()
443 slot->backlog += qdisc_pkt_len(skb); in sfq_enqueue()
444 slot_queue_add(slot, skb); in sfq_enqueue()
446 if (slot->qlen == 1) { /* The flow is new */ in sfq_enqueue()
448 slot->next = x; in sfq_enqueue()
450 slot->next = q->tail->next; in sfq_enqueue()
457 q->tail = slot; in sfq_enqueue()
459 slot->allot = q->scaled_quantum; in sfq_enqueue()
464 qlen = slot->qlen; in sfq_enqueue()
469 if (qlen != slot->qlen) { in sfq_enqueue()
485 struct sfq_slot *slot; in sfq_dequeue() local
493 slot = &q->slots[a]; in sfq_dequeue()
494 if (slot->allot <= 0) { in sfq_dequeue()
495 q->tail = slot; in sfq_dequeue()
496 slot->allot += q->scaled_quantum; in sfq_dequeue()
499 skb = slot_dequeue_head(slot); in sfq_dequeue()
504 slot->backlog -= qdisc_pkt_len(skb); in sfq_dequeue()
505 /* Is the slot empty? */ in sfq_dequeue()
506 if (slot->qlen == 0) { in sfq_dequeue()
507 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_dequeue()
508 next_a = slot->next; in sfq_dequeue()
515 slot->allot -= SFQ_ALLOT_SIZE(qdisc_pkt_len(skb)); in sfq_dequeue()
540 struct sfq_slot *slot; in sfq_rehash() local
548 slot = &q->slots[i]; in sfq_rehash()
549 if (!slot->qlen) in sfq_rehash()
551 while (slot->qlen) { in sfq_rehash()
552 skb = slot_dequeue_head(slot); in sfq_rehash()
556 slot->backlog = 0; in sfq_rehash()
557 red_set_vars(&slot->vars); in sfq_rehash()
558 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_rehash()
566 slot = &q->slots[x]; in sfq_rehash()
568 x = q->dep[0].next; /* get a free slot */ in sfq_rehash()
578 slot = &q->slots[x]; in sfq_rehash()
579 slot->hash = hash; in sfq_rehash()
581 if (slot->qlen >= q->maxdepth) in sfq_rehash()
583 slot_queue_add(slot, skb); in sfq_rehash()
585 slot->vars.qavg = red_calc_qavg(q->red_parms, in sfq_rehash()
586 &slot->vars, in sfq_rehash()
587 slot->backlog); in sfq_rehash()
588 slot->backlog += qdisc_pkt_len(skb); in sfq_rehash()
590 if (slot->qlen == 1) { /* The flow is new */ in sfq_rehash()
592 slot->next = x; in sfq_rehash()
594 slot->next = q->tail->next; in sfq_rehash()
597 q->tail = slot; in sfq_rehash()
598 slot->allot = q->scaled_quantum; in sfq_rehash()
644 /* slot->allot is a short, make sure quantum is not too big. */ in sfq_change()
874 const struct sfq_slot *slot = &q->slots[idx]; in sfq_dump_class_stats() local
876 xstats.allot = slot->allot << SFQ_ALLOT_SHIFT; in sfq_dump_class_stats()
877 qs.qlen = slot->qlen; in sfq_dump_class_stats()
878 qs.backlog = slot->backlog; in sfq_dump_class_stats()