Subject: Re: [PATCH 10/13]: net: Implement simple sw TX hashing.

From: Patrick McHardy <[email-masked]>
Date: Thu, 17 Jul 2008 18:21:27 +0200

Stephen Hemminger wrote:
> On Thu, 10 Jul 2008 03:57:13 -0700 (PDT)
> David Miller <[email-masked]> wrote:
> 
>> It just xor hashes over IPv4/IPv6 addresses and ports of transport.
>>
>> The only assumption it makes is that skb_network_header() is set
>> correctly.
>>
>> +	switch (ip_proto) {
>> +	case IPPROTO_TCP:
>> +	case IPPROTO_UDP:
>> +	case IPPROTO_DCCP:
>> +	case IPPROTO_ESP:
>> +	case IPPROTO_AH:
>> +	case IPPROTO_SCTP:
>> +	case IPPROTO_UDPLITE:
>> +		hash ^= *ports;
>> +		break;
>> +
>> +	default:
>> +		break;
>> +	}
>> +
>> +	return hash % dev->real_num_tx_queues;
>> +}
> 
> What about VLAN's? and PPPoE?

Actually I think we could just make the number of tx queues of
virtual devices match the lower device and use the unencapsulated
packets for queue selection.

Of course that would require not to perform queue selection
again on the real device. For VLANs, macvlan etc. that don't
do any locking internally that would probably make sense.
Not sure about PPPoE.