diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_vs.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index d3a4b934d521..d6146b4811c2 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -784,6 +784,16 @@ struct ip_vs_app { | |||
784 | void (*timeout_change)(struct ip_vs_app *app, int flags); | 784 | void (*timeout_change)(struct ip_vs_app *app, int flags); |
785 | }; | 785 | }; |
786 | 786 | ||
787 | struct ipvs_master_sync_state { | ||
788 | struct list_head sync_queue; | ||
789 | struct ip_vs_sync_buff *sync_buff; | ||
790 | int sync_queue_len; | ||
791 | unsigned int sync_queue_delay; | ||
792 | struct task_struct *master_thread; | ||
793 | struct delayed_work master_wakeup_work; | ||
794 | struct netns_ipvs *ipvs; | ||
795 | }; | ||
796 | |||
787 | /* IPVS in network namespace */ | 797 | /* IPVS in network namespace */ |
788 | struct netns_ipvs { | 798 | struct netns_ipvs { |
789 | int gen; /* Generation */ | 799 | int gen; /* Generation */ |
@@ -870,6 +880,7 @@ struct netns_ipvs { | |||
870 | #endif | 880 | #endif |
871 | int sysctl_snat_reroute; | 881 | int sysctl_snat_reroute; |
872 | int sysctl_sync_ver; | 882 | int sysctl_sync_ver; |
883 | int sysctl_sync_ports; | ||
873 | int sysctl_sync_qlen_max; | 884 | int sysctl_sync_qlen_max; |
874 | int sysctl_sync_sock_size; | 885 | int sysctl_sync_sock_size; |
875 | int sysctl_cache_bypass; | 886 | int sysctl_cache_bypass; |
@@ -893,16 +904,11 @@ struct netns_ipvs { | |||
893 | spinlock_t est_lock; | 904 | spinlock_t est_lock; |
894 | struct timer_list est_timer; /* Estimation timer */ | 905 | struct timer_list est_timer; /* Estimation timer */ |
895 | /* ip_vs_sync */ | 906 | /* ip_vs_sync */ |
896 | struct list_head sync_queue; | ||
897 | int sync_queue_len; | ||
898 | unsigned int sync_queue_delay; | ||
899 | struct delayed_work master_wakeup_work; | ||
900 | spinlock_t sync_lock; | 907 | spinlock_t sync_lock; |
901 | struct ip_vs_sync_buff *sync_buff; | 908 | struct ipvs_master_sync_state *ms; |
902 | spinlock_t sync_buff_lock; | 909 | spinlock_t sync_buff_lock; |
903 | struct sockaddr_in sync_mcast_addr; | 910 | struct task_struct **backup_threads; |
904 | struct task_struct *master_thread; | 911 | int threads_mask; |
905 | struct task_struct *backup_thread; | ||
906 | int send_mesg_maxlen; | 912 | int send_mesg_maxlen; |
907 | int recv_mesg_maxlen; | 913 | int recv_mesg_maxlen; |
908 | volatile int sync_state; | 914 | volatile int sync_state; |
@@ -926,6 +932,7 @@ struct netns_ipvs { | |||
926 | #define IPVS_SYNC_SEND_DELAY (HZ / 50) | 932 | #define IPVS_SYNC_SEND_DELAY (HZ / 50) |
927 | #define IPVS_SYNC_CHECK_PERIOD HZ | 933 | #define IPVS_SYNC_CHECK_PERIOD HZ |
928 | #define IPVS_SYNC_FLUSH_TIME (HZ * 2) | 934 | #define IPVS_SYNC_FLUSH_TIME (HZ * 2) |
935 | #define IPVS_SYNC_PORTS_MAX (1 << 6) | ||
929 | 936 | ||
930 | #ifdef CONFIG_SYSCTL | 937 | #ifdef CONFIG_SYSCTL |
931 | 938 | ||
@@ -954,6 +961,11 @@ static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) | |||
954 | return ipvs->sysctl_sync_ver; | 961 | return ipvs->sysctl_sync_ver; |
955 | } | 962 | } |
956 | 963 | ||
964 | static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) | ||
965 | { | ||
966 | return ACCESS_ONCE(ipvs->sysctl_sync_ports); | ||
967 | } | ||
968 | |||
957 | static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) | 969 | static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) |
958 | { | 970 | { |
959 | return ipvs->sysctl_sync_qlen_max; | 971 | return ipvs->sysctl_sync_qlen_max; |
@@ -991,6 +1003,11 @@ static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) | |||
991 | return DEFAULT_SYNC_VER; | 1003 | return DEFAULT_SYNC_VER; |
992 | } | 1004 | } |
993 | 1005 | ||
1006 | static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) | ||
1007 | { | ||
1008 | return 1; | ||
1009 | } | ||
1010 | |||
994 | static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) | 1011 | static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) |
995 | { | 1012 | { |
996 | return IPVS_SYNC_QLEN_MAX; | 1013 | return IPVS_SYNC_QLEN_MAX; |
@@ -1240,7 +1257,6 @@ extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); | |||
1240 | extern struct ip_vs_stats ip_vs_stats; | 1257 | extern struct ip_vs_stats ip_vs_stats; |
1241 | extern int sysctl_ip_vs_sync_ver; | 1258 | extern int sysctl_ip_vs_sync_ver; |
1242 | 1259 | ||
1243 | extern void ip_vs_sync_switch_mode(struct net *net, int mode); | ||
1244 | extern struct ip_vs_service * | 1260 | extern struct ip_vs_service * |
1245 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, | 1261 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, |
1246 | const union nf_inet_addr *vaddr, __be16 vport); | 1262 | const union nf_inet_addr *vaddr, __be16 vport); |