diff options
author | Paolo Abeni <pabeni@redhat.com> | 2016-02-12 17:43:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-17 04:21:48 +0300 |
commit | d71785ffc7e7cae3fbdc4ea8a9d05b7a1c59f7b8 (patch) | |
tree | 142081880ca68e3f066df14ecfb2371b229e76fd /net/core/dst.c | |
parent | 0c1d70af924b966cc71e9e48920b2b635441aa50 (diff) | |
download | linux-d71785ffc7e7cae3fbdc4ea8a9d05b7a1c59f7b8.tar.xz |
net: add dst_cache to ovs vxlan lwtunnel
In case of UDP traffic with datagram length
below MTU this give about 2% performance increase
when tunneling over ipv4 and about 60% when tunneling
over ipv6
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Suggested-and-acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dst.c')
-rw-r--r-- | net/core/dst.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index a1656e3b8d72..b5cbbe07f786 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -265,7 +265,7 @@ again: lwtstate_put(dst->lwtstate); if (dst->flags & DST_METADATA) - kfree(dst); + metadata_dst_free((struct metadata_dst *)dst); else kmem_cache_free(dst->ops->kmem_cachep, dst); @@ -395,6 +395,14 @@ struct metadata_dst *metadata_dst_alloc(u8 optslen, gfp_t flags) } EXPORT_SYMBOL_GPL(metadata_dst_alloc); +void metadata_dst_free(struct metadata_dst *md_dst) +{ +#ifdef CONFIG_DST_CACHE + dst_cache_destroy(&md_dst->u.tun_info.dst_cache); +#endif + kfree(md_dst); +} + struct metadata_dst __percpu *metadata_dst_alloc_percpu(u8 optslen, gfp_t flags) { int cpu; |