Lines Matching full:slot
98 sfq_index next; /* next slot in sfq RR chain */
101 int allot; /* credit for this slot */
115 u8 cur_depth; /* depth of longest slot */
124 struct sfq_slot *tail; /* current slot in round */
194 * x : slot number [0 .. SFQ_MAX_FLOWS - 1]
199 struct sfq_slot *slot = &q->slots[x]; in sfq_link() local
200 int qlen = slot->qlen; in sfq_link()
205 slot->dep.next = n; in sfq_link()
206 slot->dep.prev = p; in sfq_link()
249 /* remove one skb from tail of slot queue */
250 static inline struct sk_buff *slot_dequeue_tail(struct sfq_slot *slot) in slot_dequeue_tail() argument
252 struct sk_buff *skb = slot->skblist_prev; in slot_dequeue_tail()
254 slot->skblist_prev = skb->prev; in slot_dequeue_tail()
255 skb->prev->next = (struct sk_buff *)slot; in slot_dequeue_tail()
260 /* remove one skb from head of slot queue */
261 static inline struct sk_buff *slot_dequeue_head(struct sfq_slot *slot) in slot_dequeue_head() argument
263 struct sk_buff *skb = slot->skblist_next; in slot_dequeue_head()
265 slot->skblist_next = skb->next; in slot_dequeue_head()
266 skb->next->prev = (struct sk_buff *)slot; in slot_dequeue_head()
271 static inline void slot_queue_init(struct sfq_slot *slot) in slot_queue_init() argument
273 memset(slot, 0, sizeof(*slot)); in slot_queue_init()
274 slot->skblist_prev = slot->skblist_next = (struct sk_buff *)slot; in slot_queue_init()
277 /* add skb to slot queue (tail add) */
278 static inline void slot_queue_add(struct sfq_slot *slot, struct sk_buff *skb) in slot_queue_add() argument
280 skb->prev = slot->skblist_prev; in slot_queue_add()
281 skb->next = (struct sk_buff *)slot; in slot_queue_add()
282 slot->skblist_prev->next = skb; in slot_queue_add()
283 slot->skblist_prev = skb; in slot_queue_add()
292 struct sfq_slot *slot; in sfq_drop() local
294 /* Queue is full! Find the longest slot and drop tail packet from it */ in sfq_drop()
297 slot = &q->slots[x]; in sfq_drop()
299 skb = q->headdrop ? slot_dequeue_head(slot) : slot_dequeue_tail(slot); in sfq_drop()
301 slot->backlog -= len; in sfq_drop()
312 slot = &q->slots[x]; in sfq_drop()
313 q->tail->next = slot->next; in sfq_drop()
314 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_drop()
344 struct sfq_slot *slot; in sfq_enqueue() local
359 slot = &q->slots[x]; in sfq_enqueue()
361 x = q->dep[0].next; /* get a free slot */ in sfq_enqueue()
365 slot = &q->slots[x]; in sfq_enqueue()
366 slot->hash = hash; in sfq_enqueue()
367 slot->backlog = 0; /* should already be 0 anyway... */ in sfq_enqueue()
368 red_set_vars(&slot->vars); in sfq_enqueue()
372 slot->vars.qavg = red_calc_qavg_no_idle_time(q->red_parms, in sfq_enqueue()
373 &slot->vars, in sfq_enqueue()
374 slot->backlog); in sfq_enqueue()
376 &slot->vars, in sfq_enqueue()
377 slot->vars.qavg)) { in sfq_enqueue()
386 INET_ECN_set_ce(slot->skblist_next)) { in sfq_enqueue()
403 INET_ECN_set_ce(slot->skblist_next)) { in sfq_enqueue()
417 if (slot->qlen >= q->maxdepth) { in sfq_enqueue()
423 head = slot_dequeue_head(slot); in sfq_enqueue()
426 slot->backlog -= delta; in sfq_enqueue()
429 slot_queue_add(slot, skb); in sfq_enqueue()
436 slot->backlog += qdisc_pkt_len(skb); in sfq_enqueue()
437 slot_queue_add(slot, skb); in sfq_enqueue()
439 if (slot->qlen == 1) { /* The flow is new */ in sfq_enqueue()
441 slot->next = x; in sfq_enqueue()
443 slot->next = q->tail->next; in sfq_enqueue()
450 q->tail = slot; in sfq_enqueue()
452 slot->allot = q->quantum; in sfq_enqueue()
457 qlen = slot->qlen; in sfq_enqueue()
462 if (qlen != slot->qlen) { in sfq_enqueue()
478 struct sfq_slot *slot; in sfq_dequeue() local
486 slot = &q->slots[a]; in sfq_dequeue()
487 if (slot->allot <= 0) { in sfq_dequeue()
488 q->tail = slot; in sfq_dequeue()
489 slot->allot += q->quantum; in sfq_dequeue()
492 skb = slot_dequeue_head(slot); in sfq_dequeue()
497 slot->backlog -= qdisc_pkt_len(skb); in sfq_dequeue()
498 /* Is the slot empty? */ in sfq_dequeue()
499 if (slot->qlen == 0) { in sfq_dequeue()
500 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_dequeue()
501 next_a = slot->next; in sfq_dequeue()
508 slot->allot -= qdisc_pkt_len(skb); in sfq_dequeue()
533 struct sfq_slot *slot; in sfq_rehash() local
541 slot = &q->slots[i]; in sfq_rehash()
542 if (!slot->qlen) in sfq_rehash()
544 while (slot->qlen) { in sfq_rehash()
545 skb = slot_dequeue_head(slot); in sfq_rehash()
549 slot->backlog = 0; in sfq_rehash()
550 red_set_vars(&slot->vars); in sfq_rehash()
551 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_rehash()
559 slot = &q->slots[x]; in sfq_rehash()
561 x = q->dep[0].next; /* get a free slot */ in sfq_rehash()
571 slot = &q->slots[x]; in sfq_rehash()
572 slot->hash = hash; in sfq_rehash()
574 if (slot->qlen >= q->maxdepth) in sfq_rehash()
576 slot_queue_add(slot, skb); in sfq_rehash()
578 slot->vars.qavg = red_calc_qavg(q->red_parms, in sfq_rehash()
579 &slot->vars, in sfq_rehash()
580 slot->backlog); in sfq_rehash()
581 slot->backlog += qdisc_pkt_len(skb); in sfq_rehash()
583 if (slot->qlen == 1) { /* The flow is new */ in sfq_rehash()
585 slot->next = x; in sfq_rehash()
587 slot->next = q->tail->next; in sfq_rehash()
590 q->tail = slot; in sfq_rehash()
591 slot->allot = q->quantum; in sfq_rehash()
904 const struct sfq_slot *slot = &q->slots[idx]; in sfq_dump_class_stats() local
906 xstats.allot = slot->allot; in sfq_dump_class_stats()
907 qs.qlen = slot->qlen; in sfq_dump_class_stats()
908 qs.backlog = slot->backlog; in sfq_dump_class_stats()