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 if (slot->next == x) in sfq_drop()
316 q->tail->next = slot->next; in sfq_drop()
317 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_drop()
347 struct sfq_slot *slot; in sfq_enqueue() local
362 slot = &q->slots[x]; in sfq_enqueue()
364 x = q->dep[0].next; /* get a free slot */ in sfq_enqueue()
368 slot = &q->slots[x]; in sfq_enqueue()
369 slot->hash = hash; in sfq_enqueue()
370 slot->backlog = 0; /* should already be 0 anyway... */ in sfq_enqueue()
371 red_set_vars(&slot->vars); in sfq_enqueue()
375 slot->vars.qavg = red_calc_qavg_no_idle_time(q->red_parms, in sfq_enqueue()
376 &slot->vars, in sfq_enqueue()
377 slot->backlog); in sfq_enqueue()
379 &slot->vars, in sfq_enqueue()
380 slot->vars.qavg)) { in sfq_enqueue()
389 INET_ECN_set_ce(slot->skblist_next)) { in sfq_enqueue()
406 INET_ECN_set_ce(slot->skblist_next)) { in sfq_enqueue()
420 if (slot->qlen >= q->maxdepth) { in sfq_enqueue()
426 head = slot_dequeue_head(slot); in sfq_enqueue()
429 slot->backlog -= delta; in sfq_enqueue()
432 slot_queue_add(slot, skb); in sfq_enqueue()
439 slot->backlog += qdisc_pkt_len(skb); in sfq_enqueue()
440 slot_queue_add(slot, skb); in sfq_enqueue()
442 if (slot->qlen == 1) { /* The flow is new */ in sfq_enqueue()
444 slot->next = x; in sfq_enqueue()
446 slot->next = q->tail->next; in sfq_enqueue()
453 q->tail = slot; in sfq_enqueue()
455 slot->allot = q->quantum; in sfq_enqueue()
460 qlen = slot->qlen; in sfq_enqueue()
465 if (qlen != slot->qlen) { in sfq_enqueue()
481 struct sfq_slot *slot; in sfq_dequeue() local
489 slot = &q->slots[a]; in sfq_dequeue()
490 if (slot->allot <= 0) { in sfq_dequeue()
491 q->tail = slot; in sfq_dequeue()
492 slot->allot += q->quantum; in sfq_dequeue()
495 skb = slot_dequeue_head(slot); in sfq_dequeue()
500 slot->backlog -= qdisc_pkt_len(skb); in sfq_dequeue()
501 /* Is the slot empty? */ in sfq_dequeue()
502 if (slot->qlen == 0) { in sfq_dequeue()
503 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_dequeue()
504 next_a = slot->next; in sfq_dequeue()
511 slot->allot -= qdisc_pkt_len(skb); in sfq_dequeue()
536 struct sfq_slot *slot; in sfq_rehash() local
544 slot = &q->slots[i]; in sfq_rehash()
545 if (!slot->qlen) in sfq_rehash()
547 while (slot->qlen) { in sfq_rehash()
548 skb = slot_dequeue_head(slot); in sfq_rehash()
552 slot->backlog = 0; in sfq_rehash()
553 red_set_vars(&slot->vars); in sfq_rehash()
554 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_rehash()
562 slot = &q->slots[x]; in sfq_rehash()
564 x = q->dep[0].next; /* get a free slot */ in sfq_rehash()
574 slot = &q->slots[x]; in sfq_rehash()
575 slot->hash = hash; in sfq_rehash()
577 if (slot->qlen >= q->maxdepth) in sfq_rehash()
579 slot_queue_add(slot, skb); in sfq_rehash()
581 slot->vars.qavg = red_calc_qavg(q->red_parms, in sfq_rehash()
582 &slot->vars, in sfq_rehash()
583 slot->backlog); in sfq_rehash()
584 slot->backlog += qdisc_pkt_len(skb); in sfq_rehash()
586 if (slot->qlen == 1) { /* The flow is new */ in sfq_rehash()
588 slot->next = x; in sfq_rehash()
590 slot->next = q->tail->next; in sfq_rehash()
593 q->tail = slot; in sfq_rehash()
594 slot->allot = q->quantum; in sfq_rehash()
913 const struct sfq_slot *slot = &q->slots[idx]; in sfq_dump_class_stats() local
915 xstats.allot = slot->allot; in sfq_dump_class_stats()
916 qs.qlen = slot->qlen; in sfq_dump_class_stats()
917 qs.backlog = slot->backlog; in sfq_dump_class_stats()