| To: | Thomas Graf <tgraf@xxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] improvement on net/sched/cls_fw.c's hash function |
| From: | emann@xxxxxxx (Eran Mann) |
| Date: | Wed, 06 Apr 2005 16:36:20 +0300 |
| Cc: | Wang Jian <lark@xxxxxxxxxxxx>, hadi@xxxxxxxxxx, netdev <netdev@xxxxxxxxxxx> |
| In-reply-to: | <20050406123036.GO26731@postel.suug.ch> |
| References: | <20050405213023.0256.LARK@linux.net.cn> <1112717495.1076.22.camel@jzny.localdomain> <20050406143842.026B.LARK@linux.net.cn> <20050406123036.GO26731@postel.suug.ch> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla Thunderbird 1.0 (X11/20041206) |
Thomas Graf wrote:
We need to provide some kind of option to the user so he can specify the needs. The & 0xFF will suit most just fine but has one essential drawback which is that no distribution is done at all if the lower 8 bits are set to 0. For static marks this is no issue at all and even for enumerated marks growing it takes quite some time to grow into an area where it starts hurting. The problem obviously is if someone splits the mark field into 2 parts and uses the upper 16 bits for some special purpose just like you did. In such as case it would make sense to either take all bits into account or let the user specify a bitmask + shift. Maybe you could add to the list of options a XOR of bytes hash, something like: static inline u8 bytes_xor_u32( u32 key ) { u8 *dummy_array = (u8 *)&key; u8 hash = dummy_array[0] ^ dummy_array[1] ^ dummy_array[2] ^ dummy_array[3]; return hash; } -- Eran Mann MRV International www.mrv.com |
| Previous by Date: | Re: [PATCH] improvement on net/sched/cls_fw.c's hash function, jamal |
|---|---|
| Next by Date: | Re: [PATCH] improvement on net/sched/cls_fw.c's hash function, Thomas Graf |
| Previous by Thread: | Re: [PATCH] [PKT_SCHED]: improve hashing performance of cls_fw, Wang Jian |
| Next by Thread: | Re: [PATCH] improvement on net/sched/cls_fw.c's hash function, Wang Jian |
| Indexes: | [Date] [Thread] [Top] [All Lists] |