summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-08-15 10:25:42 +0000
committerbrian <brian@FreeBSD.org>2000-08-15 10:25:42 +0000
commit2e8f0fe474c0ef6857cb0581ea2879daccbf85b1 (patch)
tree9d83481cb2a113087032c12eb168892b507b84f6 /usr.sbin/ppp/mp.c
parentead30e83239251cba3bf2fd08387ab9e4963dbe7 (diff)
downloadFreeBSD-src-2e8f0fe474c0ef6857cb0581ea2879daccbf85b1.zip
FreeBSD-src-2e8f0fe474c0ef6857cb0581ea2879daccbf85b1.tar.gz
Maintain input and output throughput averages and choose the highest
of the two when calculating the MP throughput average for the ``set autoload'' implementation. This makes more sense as all links I know of are full-duplex. This also means that people may need to adjust their autoload settings as 100% bandwidth is now the theoretical maximum rather than 200% (but of course, halfing the current settings is probably not the correct answer either!). This involves a ppp version bump as we need to pass an extra throughput array through the MP local domain socket.
Diffstat (limited to 'usr.sbin/ppp/mp.c')
-rw-r--r--usr.sbin/ppp/mp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index df152f7..5397243 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/ppp/mp.c
@@ -189,7 +189,9 @@ mp_UpDown(void *v)
struct mp *mp = (struct mp *)v;
int percent;
- percent = mp->link.stats.total.OctetsPerSecond * 800 / mp->bundle->bandwidth;
+ percent = MAX(mp->link.stats.total.in.OctetsPerSecond,
+ mp->link.stats.total.out.OctetsPerSecond) * 800 /
+ mp->bundle->bandwidth;
if (percent >= mp->cfg.autoload.max) {
log_Printf(LogDEBUG, "%d%% saturation - bring a link up ?\n", percent);
bundle_AutoAdjust(mp->bundle, percent, AUTO_UP);
OpenPOWER on IntegriCloud