Subject: Re: [PATCH] Stochastic Fair Blue queue discipline

From: Patrick McHardy <[email-masked]>
Date: Tue, 08 Apr 2008 14:11:27 +0200

Andi Kleen wrote:
> Juliusz Chroboczek <[email-masked]> writes:
> 
> 
> Have not read everything. General comment you'll likely need to 
> do some code style cleanups (read Documentation/CodingStyle) 
> Especially indentation should be consistent (one easy way 
> to get that would be to run it through Lindent, although you
> might need to review it afterwards because Lindent sometimes does
> weird things)
> 
>> +
>> +static unsigned sfb_hash(struct sk_buff *skb, int hash, int filter,
>> +                         struct sfb_sched_data *q)
>> +{
>> +	u32 h, h2;
>> +        u8 hash_type = q->hash_type;
>> +
>> +	switch (skb->protocol) {
>> +	case __constant_htons(ETH_P_IP):
> 
> I think we have multiple qdiscs now doing very similar such hashes.
> Any chance this could be factored out into a common library function 
> first?

I'd suggest to use the flow classifier for this. For simplicity
you could attach a default classifier that uses the same keys as
this one.