Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f9e98f7 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

[PKT_SCHED] SFQ: whitespace cleanup



Add whitespace around operators, and add a few blank lines to improve
readability.

Signed-off-by: default avatarStephen Hemminger <stephen.hemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d46f8dd8
Loading
Loading
Loading
Loading
+25 −17
Original line number Diff line number Diff line
@@ -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);
}

@@ -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.
@@ -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
@@ -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 */
@@ -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;
@@ -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;
@@ -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;