diff options
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index cbb59ebed4ae..7312c3dd309f 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -140,8 +140,24 @@ struct ip_vs_seq { | |||
140 | 140 | ||
141 | 141 | ||
142 | /* | 142 | /* |
143 | * IPVS statistics object | 143 | * IPVS statistics objects |
144 | */ | 144 | */ |
145 | struct ip_vs_estimator { | ||
146 | struct list_head list; | ||
147 | |||
148 | u64 last_inbytes; | ||
149 | u64 last_outbytes; | ||
150 | u32 last_conns; | ||
151 | u32 last_inpkts; | ||
152 | u32 last_outpkts; | ||
153 | |||
154 | u32 cps; | ||
155 | u32 inpps; | ||
156 | u32 outpps; | ||
157 | u32 inbps; | ||
158 | u32 outbps; | ||
159 | }; | ||
160 | |||
145 | struct ip_vs_stats | 161 | struct ip_vs_stats |
146 | { | 162 | { |
147 | __u32 conns; /* connections scheduled */ | 163 | __u32 conns; /* connections scheduled */ |
@@ -156,7 +172,15 @@ struct ip_vs_stats | |||
156 | __u32 inbps; /* current in byte rate */ | 172 | __u32 inbps; /* current in byte rate */ |
157 | __u32 outbps; /* current out byte rate */ | 173 | __u32 outbps; /* current out byte rate */ |
158 | 174 | ||
175 | /* | ||
176 | * Don't add anything before the lock, because we use memcpy() to copy | ||
177 | * the members before the lock to struct ip_vs_stats_user in | ||
178 | * ip_vs_ctl.c. | ||
179 | */ | ||
180 | |||
159 | spinlock_t lock; /* spin lock */ | 181 | spinlock_t lock; /* spin lock */ |
182 | |||
183 | struct ip_vs_estimator est; /* estimator */ | ||
160 | }; | 184 | }; |
161 | 185 | ||
162 | struct dst_entry; | 186 | struct dst_entry; |
@@ -440,7 +464,7 @@ struct ip_vs_app | |||
440 | */ | 464 | */ |
441 | extern const char *ip_vs_proto_name(unsigned proto); | 465 | extern const char *ip_vs_proto_name(unsigned proto); |
442 | extern void ip_vs_init_hash_table(struct list_head *table, int rows); | 466 | extern void ip_vs_init_hash_table(struct list_head *table, int rows); |
443 | #define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table(t, sizeof(t)/sizeof(t[0])) | 467 | #define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table((t), ARRAY_SIZE((t))) |
444 | 468 | ||
445 | #define IP_VS_APP_TYPE_FTP 1 | 469 | #define IP_VS_APP_TYPE_FTP 1 |
446 | 470 | ||
@@ -620,7 +644,7 @@ extern int sysctl_ip_vs_expire_quiescent_template; | |||
620 | extern int sysctl_ip_vs_sync_threshold[2]; | 644 | extern int sysctl_ip_vs_sync_threshold[2]; |
621 | extern int sysctl_ip_vs_nat_icmp_send; | 645 | extern int sysctl_ip_vs_nat_icmp_send; |
622 | extern struct ip_vs_stats ip_vs_stats; | 646 | extern struct ip_vs_stats ip_vs_stats; |
623 | extern struct ctl_path net_vs_ctl_path[]; | 647 | extern const struct ctl_path net_vs_ctl_path[]; |
624 | 648 | ||
625 | extern struct ip_vs_service * | 649 | extern struct ip_vs_service * |
626 | ip_vs_service_get(__u32 fwmark, __u16 protocol, __be32 vaddr, __be16 vport); | 650 | ip_vs_service_get(__u32 fwmark, __u16 protocol, __be32 vaddr, __be16 vport); |
@@ -659,7 +683,7 @@ extern void ip_vs_sync_conn(struct ip_vs_conn *cp); | |||
659 | /* | 683 | /* |
660 | * IPVS rate estimator prototypes (from ip_vs_est.c) | 684 | * IPVS rate estimator prototypes (from ip_vs_est.c) |
661 | */ | 685 | */ |
662 | extern int ip_vs_new_estimator(struct ip_vs_stats *stats); | 686 | extern void ip_vs_new_estimator(struct ip_vs_stats *stats); |
663 | extern void ip_vs_kill_estimator(struct ip_vs_stats *stats); | 687 | extern void ip_vs_kill_estimator(struct ip_vs_stats *stats); |
664 | extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); | 688 | extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); |
665 | 689 | ||