diff options
author | Brian Somers <brian@FreeBSD.org> | 2000-08-15 10:25:42 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 2000-08-15 10:25:42 +0000 |
commit | 91cbd2eec0d10f7e8be60a45cb28464a8dd47f06 (patch) | |
tree | 11629aeb2a3f3c617f8ee4f27cd3cf523e2e8286 /usr.sbin/ppp/physical.c | |
parent | 3c28a656f285b560be07b8e0fc680def3e7dc548 (diff) | |
download | src-91cbd2eec0d10f7e8be60a45cb28464a8dd47f06.tar.gz src-91cbd2eec0d10f7e8be60a45cb28464a8dd47f06.zip |
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.
Notes
Notes:
svn path=/head/; revision=64670
Diffstat (limited to 'usr.sbin/ppp/physical.c')
-rw-r--r-- | usr.sbin/ppp/physical.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index 71a45a282ae7..ab0fb53ae840 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -600,7 +600,8 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov, p->hdlc.lqm.timer.state = TIMER_STOPPED; p->fd = fd; - p->link.stats.total.SampleOctets = (long long *)iov[(*niov)++].iov_base; + p->link.stats.total.in.SampleOctets = (long long *)iov[(*niov)++].iov_base; + p->link.stats.total.out.SampleOctets = (long long *)iov[(*niov)++].iov_base; p->link.stats.parent = dl->bundle->ncp.mp.active ? &dl->bundle->ncp.mp.link.stats.total : NULL; p->link.stats.gather = 1; @@ -686,7 +687,10 @@ physical2iov(struct physical *p, struct iovec *iov, int *niov, int maxiov, iov[*niov].iov_len = sizeof *p; (*niov)++; - iov[*niov].iov_base = p ? (void *)p->link.stats.total.SampleOctets : NULL; + iov[*niov].iov_base = p ? (void *)p->link.stats.total.in.SampleOctets : NULL; + iov[*niov].iov_len = SAMPLE_PERIOD * sizeof(long long); + (*niov)++; + iov[*niov].iov_base = p ? (void *)p->link.stats.total.out.SampleOctets : NULL; iov[*niov].iov_len = SAMPLE_PERIOD * sizeof(long long); (*niov)++; |