diff options
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 17b01b2d48f9..e74da41ebd1b 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -1243,6 +1243,20 @@ static inline void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp) | |||
1243 | /* CONFIG_IP_VS_NFCT */ | 1243 | /* CONFIG_IP_VS_NFCT */ |
1244 | #endif | 1244 | #endif |
1245 | 1245 | ||
1246 | static inline unsigned int | ||
1247 | ip_vs_dest_conn_overhead(struct ip_vs_dest *dest) | ||
1248 | { | ||
1249 | /* | ||
1250 | * We think the overhead of processing active connections is 256 | ||
1251 | * times higher than that of inactive connections in average. (This | ||
1252 | * 256 times might not be accurate, we will change it later) We | ||
1253 | * use the following formula to estimate the overhead now: | ||
1254 | * dest->activeconns*256 + dest->inactconns | ||
1255 | */ | ||
1256 | return (atomic_read(&dest->activeconns) << 8) + | ||
1257 | atomic_read(&dest->inactconns); | ||
1258 | } | ||
1259 | |||
1246 | #endif /* __KERNEL__ */ | 1260 | #endif /* __KERNEL__ */ |
1247 | 1261 | ||
1248 | #endif /* _NET_IP_VS_H */ | 1262 | #endif /* _NET_IP_VS_H */ |