On Sun, 2006-12-03 at 00:49 +1000, Russell Stuart wrote:

> However, assuming you are referring to the hashing function
> here - as it happens the 2.4 and 2.6 functions always
> hash to the same thing when you are hashing one byte.
> They differ when you hash two or more non-zero bytes.
> 

Right - take a look at the use of hashkey with varying divisors to see
where the 2.4 folding breaks[1]. Note you should be able to use hashkey
instead of sample and it would work fine.

> Just for reference, the 2.4 hashing function is an XOR or
> all the bytes in the value.  Although the 2.6 hashing
> function is very simple, I can't think of a short but
> precise way to describe it in English.  The best I can 
> do is to say it uses least significant byte of the value
> after masking.  But perhaps you wrote it, and so are
> familiar with it (?)
> 

Given a description of a 32 bit value/mask the hash would result in
computing the bucket selection in the table. The shift is for extracting
the significant result in the operation (which cant exceed 
8 bits).

> Anyway, to give you a feel how familiar I am (or am not,
> as the case may be) with the the U32 filter, here is a 
> URL to some doco I wrote.  I did it for my own use as
> there wasn't (and still isn't, as far as I know) - any
> decent U32 doco.  I did pass it onto Bert Hubert, but
> nothing came of that as far as I know.
> 
> http://www.stuart.id.au/russell/files/tc/cls_u32.txt
> 

I dont have time to review your text but i could later on. I also wont
be able to look at anything you send for most of today (back towards end
of day), but please go ahead and send it.

cheers,
jamal

[1] Essentially, if you teach u32 in 2.4 to spread rules over different
buckets it will not do so evenly. Off top of my head i remember that the
best you could ever do is have bucket selection in increments of 4 (so
bucket 0, 4, 8,..) with certain divisor sizes - mostly works with 256;
to work properly you need it to be (0,1,2,3,..). 
implies --> When it does work, it is detrimental to lookup speed when
you hit thousands of rules because some buckets get overloaded and
others are totaly unused and when it doesnt work, it results in
classifier misses for rules you inserted. 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to