On Tue, Dec 10, 2013 at 12:47 PM, Thomas Graf <[email protected]> wrote: > On 12/10/2013 08:36 PM, David Miller wrote: >> >> From: Jesse Gross <[email protected]> >> Date: Tue, 10 Dec 2013 11:28:08 -0800 >> >>> I think this is definitely a good optimization to do given that so >>> much of the work that OVS does is hashing. However, isn't there a >>> library where there would be a more appropriate place to put this? >> >> >> I also honestly don't see why we want to special case OVS at all >> here. This faster hashing would be useful for socket demux and >> other locations in the kernel. >> >> When I see changes like this my only reaction is "sad face". > > > We discussed this heavily and decided to go with the minimal approach > first to collect some feedback. We were not sure whether the runtime > check, function pointer and hardware dependencies are something other > subsystems that are less x86_64 centric would want to live with. > > That said, we are _very_ willing to do the work and move it to lib/ > to make it available to other consumers but one should be aware that > crc32 based hashes are not as generally usable as jhash.
Most hash users probably don't care what the actual hash function is, as long as it is consistent. Couldn't you have a function that uses CRC32 if it is available (or whatever is appropriate on a given architecture) and jhash otherwise? Most users would then be able to call this function without knowing or caring about the various quirks. We could also potentially use the static key stuff to get the right hash function as well. _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
