[PATCH] idiag: provide a hash function for idiag objects

Thomas Haller thaller at redhat.com
Mon Nov 24 04:11:41 PST 2014


On Thu, 2014-11-20 at 12:26 -0800, Cong Wang wrote:
> Without ->oo_keygen, libnl will use linear search
> for cache objects. This is extremely slow for idiag
> when we have a lot of TCP connections. Provide a
> hash function for idiag so that libnl will be able
> to lookup a hashtable.
> 
> Cc: Thomas Graf <tgraf at suug.ch>
> Cc: Thomas Haller <thaller at redhat.com>
> Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
> ---


Hi Cong,


I applied the patch to master:
https://github.com/thom311/libnl/commit/9c066b9271493ce3efff0b9d7b6e424990bba3f2


Actually, after pushing it I just realized that having oo_keygen()
without oo_compare() is wrong, because you always need an equality
function together with the hash function.

But looking into this, I found there are some other things  wrong with
idiag_msg. I'll send a patch for them soon and apply look through your
other idiag patches.

Thanks so far, soon follows more.

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20141124/f4e4dbc7/attachment.sig>


More information about the libnl mailing list