summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2013-03-21 10:58:11 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2013-04-02 00:23:45 +0200
commit1845ed0bb29fa7864781021e0c8d06af318f358a (patch)
tree022aa226f2c66912dcd79c61606d21782e759e7f /include
parentipvs: convert connection locking (diff)
downloadlinux-1845ed0bb29fa7864781021e0c8d06af318f358a.tar.xz
linux-1845ed0bb29fa7864781021e0c8d06af318f358a.zip
ipvs: reorder keys in connection structure
__ip_vs_conn_in_get and ip_vs_conn_out_get are hot places. Optimize them, so that ports are matched first. By moving net and fwmark below, on 32-bit arch we can fit caddr in 32-byte cache line and all addresses in 64-byte cache line. 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')
-rw-r--r--include/net/ip_vs.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 5700b07b5186..929e04c6b82e 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -566,20 +566,19 @@ struct ip_vs_conn_param {
*/
struct ip_vs_conn {
struct hlist_node c_list; /* hashed list heads */
-#ifdef CONFIG_NET_NS
- struct net *net; /* Name space */
-#endif
/* Protocol, addresses and port numbers */
- u16 af; /* address family */
__be16 cport;
- __be16 vport;
__be16 dport;
- __u32 fwmark; /* Fire wall mark from skb */
+ __be16 vport;
+ u16 af; /* address family */
union nf_inet_addr caddr; /* client address */
union nf_inet_addr vaddr; /* virtual address */
union nf_inet_addr daddr; /* destination address */
volatile __u32 flags; /* status flags */
__u16 protocol; /* Which protocol (TCP/UDP) */
+#ifdef CONFIG_NET_NS
+ struct net *net; /* Name space */
+#endif
/* counter and timer */
atomic_t refcnt; /* reference count */
@@ -593,6 +592,7 @@ struct ip_vs_conn {
* state transition triggerd
* synchronization
*/
+ __u32 fwmark; /* Fire wall mark from skb */
unsigned long sync_endtime; /* jiffies + sent_retries */
/* Control members */