[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090420.034628.224469114.davem@davemloft.net>
Date: Mon, 20 Apr 2009 03:46:28 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: andi@...stfloor.org
Cc: therbert@...gle.com, netdev@...r.kernel.org
Subject: Re: [PATCH] Software receive packet steering
From: Andi Kleen <andi@...stfloor.org>
Date: Mon, 20 Apr 2009 12:32:29 +0200
> Tom Herbert <therbert@...gle.com> writes:
>
>> +got_hash:
>> + hash %= cpus_weight_nr(mask);
>
> That looks rather heavyweight even on modern CPUs. I bet it's 40-50+ cycles
> alone forth the hweight and the division. Surely that can be done better?
The standard way to do this is to compute a 32-bit jenkins
hash, and do a 64-bit multiply of this value with a suitable
reciprocol.
This is what skb_tx_hash() is doing in net/core/dev.c
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists