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