diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-08-01 06:29:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-02 18:31:31 -0400 |
commit | d4ad4d22e7ac6b8711b35d7e86eb29f03f8ac153 (patch) | |
tree | 929ebb9bc76b52037572bfb58475112989b51ba0 /net/ipv4/ip_fragment.c | |
parent | 2e404f632f44979ddf0ce0808a438249a72d7015 (diff) |
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>
Diffstat (limited to 'net/ipv4/ip_fragment.c')
-rw-r--r-- | net/ipv4/ip_fragment.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index cb56bcc1eee2..15f0e2bad7ad 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -55,6 +55,7 @@ | |||
55 | */ | 55 | */ |
56 | 56 | ||
57 | static int sysctl_ipfrag_max_dist __read_mostly = 64; | 57 | static int sysctl_ipfrag_max_dist __read_mostly = 64; |
58 | static const char ip_frag_cache_name[] = "ip4-frags"; | ||
58 | 59 | ||
59 | struct ipfrag_skb_cb | 60 | struct ipfrag_skb_cb |
60 | { | 61 | { |
@@ -860,5 +861,7 @@ void __init ipfrag_init(void) | |||
860 | ip4_frags.qsize = sizeof(struct ipq); | 861 | ip4_frags.qsize = sizeof(struct ipq); |
861 | ip4_frags.match = ip4_frag_match; | 862 | ip4_frags.match = ip4_frag_match; |
862 | ip4_frags.frag_expire = ip_expire; | 863 | ip4_frags.frag_expire = ip_expire; |
863 | inet_frags_init(&ip4_frags); | 864 | ip4_frags.frags_cache_name = ip_frag_cache_name; |
865 | if (inet_frags_init(&ip4_frags)) | ||
866 | panic("IP: failed to allocate ip4_frags cache\n"); | ||
864 | } | 867 | } |