inet: frags: use kmem_cache for inet_frag_queue
Use kmem_cache to allocate/free inet_frag_queue objects since they're all the same size per inet_frags user and are alloced/freed in high volumes thus making it a perfect case for kmem_cache. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
2e404f632f
commit
d4ad4d22e7
@@ -30,6 +30,8 @@
|
||||
|
||||
#include "reassembly.h"
|
||||
|
||||
static const char lowpan_frags_cache_name[] = "lowpan-frags";
|
||||
|
||||
struct lowpan_frag_info {
|
||||
__be16 d_tag;
|
||||
u16 d_size;
|
||||
@@ -571,7 +573,10 @@ int __init lowpan_net_frag_init(void)
|
||||
lowpan_frags.qsize = sizeof(struct frag_queue);
|
||||
lowpan_frags.match = lowpan_frag_match;
|
||||
lowpan_frags.frag_expire = lowpan_frag_expire;
|
||||
inet_frags_init(&lowpan_frags);
|
||||
lowpan_frags.frags_cache_name = lowpan_frags_cache_name;
|
||||
ret = inet_frags_init(&lowpan_frags);
|
||||
if (ret)
|
||||
goto err_pernet;
|
||||
|
||||
return ret;
|
||||
err_pernet:
|
||||
|
Reference in New Issue
Block a user