diff options
author | Julian Anastasov <ja@ssi.bg> | 2013-03-21 05:58:11 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-04-01 18:23:45 -0400 |
commit | 1845ed0bb29fa7864781021e0c8d06af318f358a (patch) | |
tree | 022aa226f2c66912dcd79c61606d21782e759e7f /include/net/ip_vs.h | |
parent | 088339a57d6042a8a19a3d5794594b558cd7b624 (diff) |
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/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 12 |
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 { | |||
566 | */ | 566 | */ |
567 | struct ip_vs_conn { | 567 | struct ip_vs_conn { |
568 | struct hlist_node c_list; /* hashed list heads */ | 568 | struct hlist_node c_list; /* hashed list heads */ |
569 | #ifdef CONFIG_NET_NS | ||
570 | struct net *net; /* Name space */ | ||
571 | #endif | ||
572 | /* Protocol, addresses and port numbers */ | 569 | /* Protocol, addresses and port numbers */ |
573 | u16 af; /* address family */ | ||
574 | __be16 cport; | 570 | __be16 cport; |
575 | __be16 vport; | ||
576 | __be16 dport; | 571 | __be16 dport; |
577 | __u32 fwmark; /* Fire wall mark from skb */ | 572 | __be16 vport; |
573 | u16 af; /* address family */ | ||
578 | union nf_inet_addr caddr; /* client address */ | 574 | union nf_inet_addr caddr; /* client address */ |
579 | union nf_inet_addr vaddr; /* virtual address */ | 575 | union nf_inet_addr vaddr; /* virtual address */ |
580 | union nf_inet_addr daddr; /* destination address */ | 576 | union nf_inet_addr daddr; /* destination address */ |
581 | volatile __u32 flags; /* status flags */ | 577 | volatile __u32 flags; /* status flags */ |
582 | __u16 protocol; /* Which protocol (TCP/UDP) */ | 578 | __u16 protocol; /* Which protocol (TCP/UDP) */ |
579 | #ifdef CONFIG_NET_NS | ||
580 | struct net *net; /* Name space */ | ||
581 | #endif | ||
583 | 582 | ||
584 | /* counter and timer */ | 583 | /* counter and timer */ |
585 | atomic_t refcnt; /* reference count */ | 584 | atomic_t refcnt; /* reference count */ |
@@ -593,6 +592,7 @@ struct ip_vs_conn { | |||
593 | * state transition triggerd | 592 | * state transition triggerd |
594 | * synchronization | 593 | * synchronization |
595 | */ | 594 | */ |
595 | __u32 fwmark; /* Fire wall mark from skb */ | ||
596 | unsigned long sync_endtime; /* jiffies + sent_retries */ | 596 | unsigned long sync_endtime; /* jiffies + sent_retries */ |
597 | 597 | ||
598 | /* Control members */ | 598 | /* Control members */ |