summaryrefslogtreecommitdiffstats
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2013-03-21 10:58:12 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2013-04-02 00:23:46 +0200
commit9a05475cebdd6341884b5901e53870be26e65158 (patch)
tree26472546bb3f5e0c49e147790859fc7b7e307789 /include/net/ip_vs.h
parentipvs: reorder keys in connection structure (diff)
downloadlinux-9a05475cebdd6341884b5901e53870be26e65158.tar.xz
linux-9a05475cebdd6341884b5901e53870be26e65158.zip
ipvs: avoid kmem_cache_zalloc in ip_vs_conn_new
We have many fields to set and few to reset, use kmem_cache_alloc instead to save some cycles. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off by: Hans Schillstrom <hans@schillstrom.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 929e04c6b82e..43886bb282fb 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -233,6 +233,21 @@ static inline void ip_vs_addr_copy(int af, union nf_inet_addr *dst,
dst->ip = src->ip;
}
+static inline void ip_vs_addr_set(int af, union nf_inet_addr *dst,
+ const union nf_inet_addr *src)
+{
+#ifdef CONFIG_IP_VS_IPV6
+ if (af == AF_INET6) {
+ dst->in6 = src->in6;
+ return;
+ }
+#endif
+ dst->ip = src->ip;
+ dst->all[1] = 0;
+ dst->all[2] = 0;
+ dst->all[3] = 0;
+}
+
static inline int ip_vs_addr_equal(int af, const union nf_inet_addr *a,
const union nf_inet_addr *b)
{