Loading net/sched/sch_sfq.c +25 −17 Original line number Diff line number Diff line Loading @@ -148,9 +148,10 @@ static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) break; } default: h = (u32)(unsigned long)skb->dst^skb->protocol; h2 = (u32)(unsigned long)skb->sk; h = (unsigned long)skb->dst ^ skb->protocol; h2 = (unsigned long)skb->sk; } return sfq_fold_hash(q, h, h2); } Loading Loading @@ -252,6 +253,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch) q->ht[hash] = x = q->dep[SFQ_DEPTH].next; q->hash[x] = hash; } /* If selected queue has length q->limit, this means that * all another queues are empty and that we do simple tail drop, * i.e. drop _this_ packet. Loading Loading @@ -295,6 +297,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) q->ht[hash] = x = q->dep[SFQ_DEPTH].next; q->hash[x] = hash; } sch->qstats.backlog += skb->len; __skb_queue_head(&q->qs[x], skb); /* If selected queue has length q->limit+1, this means that Loading @@ -310,6 +313,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) kfree_skb(skb); return NET_XMIT_CN; } sfq_inc(q, x); if (q->qs[x].qlen == 1) { /* The flow is new */ if (q->tail == SFQ_DEPTH) { /* It is the first flow */ Loading @@ -322,6 +326,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) q->tail = x; } } if (++sch->q.qlen <= q->limit) { sch->qstats.requeues++; return 0; Loading Loading @@ -432,11 +437,13 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) for (i = 0; i < SFQ_HASH_DIVISOR; i++) q->ht[i] = SFQ_DEPTH; for (i = 0; i < SFQ_DEPTH; i++) { skb_queue_head_init(&q->qs[i]); q->dep[i + SFQ_DEPTH].next = i + SFQ_DEPTH; q->dep[i + SFQ_DEPTH].prev = i + SFQ_DEPTH; } q->limit = SFQ_DEPTH - 1; q->max_depth = 0; q->tail = SFQ_DEPTH; Loading @@ -449,6 +456,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) if (err) return err; } for (i = 0; i < SFQ_DEPTH; i++) sfq_link(q, i); return 0; Loading Loading
net/sched/sch_sfq.c +25 −17 Original line number Diff line number Diff line Loading @@ -148,9 +148,10 @@ static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) break; } default: h = (u32)(unsigned long)skb->dst^skb->protocol; h2 = (u32)(unsigned long)skb->sk; h = (unsigned long)skb->dst ^ skb->protocol; h2 = (unsigned long)skb->sk; } return sfq_fold_hash(q, h, h2); } Loading Loading @@ -252,6 +253,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch) q->ht[hash] = x = q->dep[SFQ_DEPTH].next; q->hash[x] = hash; } /* If selected queue has length q->limit, this means that * all another queues are empty and that we do simple tail drop, * i.e. drop _this_ packet. Loading Loading @@ -295,6 +297,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) q->ht[hash] = x = q->dep[SFQ_DEPTH].next; q->hash[x] = hash; } sch->qstats.backlog += skb->len; __skb_queue_head(&q->qs[x], skb); /* If selected queue has length q->limit+1, this means that Loading @@ -310,6 +313,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) kfree_skb(skb); return NET_XMIT_CN; } sfq_inc(q, x); if (q->qs[x].qlen == 1) { /* The flow is new */ if (q->tail == SFQ_DEPTH) { /* It is the first flow */ Loading @@ -322,6 +326,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) q->tail = x; } } if (++sch->q.qlen <= q->limit) { sch->qstats.requeues++; return 0; Loading Loading @@ -432,11 +437,13 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) for (i = 0; i < SFQ_HASH_DIVISOR; i++) q->ht[i] = SFQ_DEPTH; for (i = 0; i < SFQ_DEPTH; i++) { skb_queue_head_init(&q->qs[i]); q->dep[i + SFQ_DEPTH].next = i + SFQ_DEPTH; q->dep[i + SFQ_DEPTH].prev = i + SFQ_DEPTH; } q->limit = SFQ_DEPTH - 1; q->max_depth = 0; q->tail = SFQ_DEPTH; Loading @@ -449,6 +456,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) if (err) return err; } for (i = 0; i < SFQ_DEPTH; i++) sfq_link(q, i); return 0; Loading