aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
authorHans Schillstrom <hans.schillstrom@ericsson.com>2011-01-03 08:44:58 -0500
committerSimon Horman <horms@verge.net.au>2011-01-12 20:30:28 -0500
commita0840e2e165a370ca24a59545e564e9881a55891 (patch)
treedeb10e3931be9410aebbb55e5fccbd42a5edd633 /include/net/ip_vs.h
parent6e67e586e7289c144d5a189d6e0fa7141d025746 (diff)
IPVS: netns, ip_vs_ctl local vars moved to ipvs struct.
Moving global vars to ipvs struct, except for svc table lock. Next patch for ctl will be drop-rate handling. *v3 __ip_vs_mutex remains global ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index f82c0ffdee74..af9acf44e40a 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -41,7 +41,7 @@ static inline struct netns_ipvs *net_ipvs(struct net* net)
41 * Get net ptr from skb in traffic cases 41 * Get net ptr from skb in traffic cases
42 * use skb_sknet when call is from userland (ioctl or netlink) 42 * use skb_sknet when call is from userland (ioctl or netlink)
43 */ 43 */
44static inline struct net *skb_net(struct sk_buff *skb) 44static inline struct net *skb_net(const struct sk_buff *skb)
45{ 45{
46#ifdef CONFIG_NET_NS 46#ifdef CONFIG_NET_NS
47#ifdef CONFIG_IP_VS_DEBUG 47#ifdef CONFIG_IP_VS_DEBUG
@@ -69,7 +69,7 @@ static inline struct net *skb_net(struct sk_buff *skb)
69#endif 69#endif
70} 70}
71 71
72static inline struct net *skb_sknet(struct sk_buff *skb) 72static inline struct net *skb_sknet(const struct sk_buff *skb)
73{ 73{
74#ifdef CONFIG_NET_NS 74#ifdef CONFIG_NET_NS
75#ifdef CONFIG_IP_VS_DEBUG 75#ifdef CONFIG_IP_VS_DEBUG
@@ -1023,13 +1023,6 @@ extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
1023/* 1023/*
1024 * IPVS control data and functions (from ip_vs_ctl.c) 1024 * IPVS control data and functions (from ip_vs_ctl.c)
1025 */ 1025 */
1026extern int sysctl_ip_vs_cache_bypass;
1027extern int sysctl_ip_vs_expire_nodest_conn;
1028extern int sysctl_ip_vs_expire_quiescent_template;
1029extern int sysctl_ip_vs_sync_threshold[2];
1030extern int sysctl_ip_vs_nat_icmp_send;
1031extern int sysctl_ip_vs_conntrack;
1032extern int sysctl_ip_vs_snat_reroute;
1033extern struct ip_vs_stats ip_vs_stats; 1026extern struct ip_vs_stats ip_vs_stats;
1034extern const struct ctl_path net_vs_ctl_path[]; 1027extern const struct ctl_path net_vs_ctl_path[];
1035extern int sysctl_ip_vs_sync_ver; 1028extern int sysctl_ip_vs_sync_ver;
@@ -1119,11 +1112,13 @@ extern int ip_vs_icmp_xmit_v6
1119extern int ip_vs_drop_rate; 1112extern int ip_vs_drop_rate;
1120extern int ip_vs_drop_counter; 1113extern int ip_vs_drop_counter;
1121 1114
1122static __inline__ int ip_vs_todrop(void) 1115static inline int ip_vs_todrop(struct netns_ipvs *ipvs)
1123{ 1116{
1124 if (!ip_vs_drop_rate) return 0; 1117 if (!ipvs->drop_rate)
1125 if (--ip_vs_drop_counter > 0) return 0; 1118 return 0;
1126 ip_vs_drop_counter = ip_vs_drop_rate; 1119 if (--ipvs->drop_counter > 0)
1120 return 0;
1121 ipvs->drop_counter = ipvs->drop_rate;
1127 return 1; 1122 return 1;
1128} 1123}
1129 1124
@@ -1211,9 +1206,9 @@ static inline void ip_vs_notrack(struct sk_buff *skb)
1211 * Netfilter connection tracking 1206 * Netfilter connection tracking
1212 * (from ip_vs_nfct.c) 1207 * (from ip_vs_nfct.c)
1213 */ 1208 */
1214static inline int ip_vs_conntrack_enabled(void) 1209static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs)
1215{ 1210{
1216 return sysctl_ip_vs_conntrack; 1211 return ipvs->sysctl_conntrack;
1217} 1212}
1218 1213
1219extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, 1214extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
@@ -1226,7 +1221,7 @@ extern void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp);
1226 1221
1227#else 1222#else
1228 1223
1229static inline int ip_vs_conntrack_enabled(void) 1224static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs)
1230{ 1225{
1231 return 0; 1226 return 0;
1232} 1227}