* counters overflow
@ 2004-09-29 5:20 Dmitry Vereschaka
2004-09-29 6:16 ` David Ananian-Cooper
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Dmitry Vereschaka @ 2004-09-29 5:20 UTC (permalink / raw)
To: linux-ppp
Hello linux-ppp,
The problem is that counters for 'bytes in' and 'bytes out' are 32 bit integers, which
is enough for counting data while connected via modem, but really small while using
pppoe or pptpd-based solutions deployed over 100/1000mbit network.
--
Best regards,
Dmitry mailto:dmitry@rsl.ru
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: counters overflow
2004-09-29 5:20 counters overflow Dmitry Vereschaka
@ 2004-09-29 6:16 ` David Ananian-Cooper
2004-09-29 16:10 ` Bill Unruh
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: David Ananian-Cooper @ 2004-09-29 6:16 UTC (permalink / raw)
To: linux-ppp
[-- Attachment #1: Type: text/plain, Size: 655 bytes --]
hi
i've encountered the same problem working the code while writing a plugin. i
managed to get around it by taking a copy of the counters every few minutes
and noting when they loop around to zero (i.e. when old_value > new_value).
its a bit of a hack, but it seems to work for my purposes.
david ananian-cooper
On Wed, 29 Sep 2004 15:20, Dmitry Vereschaka wrote:
> Hello linux-ppp,
>
> The problem is that counters for 'bytes in' and 'bytes out' are 32 bit
> integers, which is enough for counting data while connected via modem, but
> really small while using pppoe or pptpd-based solutions deployed over
> 100/1000mbit network.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: counters overflow
2004-09-29 5:20 counters overflow Dmitry Vereschaka
2004-09-29 6:16 ` David Ananian-Cooper
@ 2004-09-29 16:10 ` Bill Unruh
2004-09-30 2:10 ` Paul Mackerras
2004-09-30 17:33 ` carlsonj
3 siblings, 0 replies; 5+ messages in thread
From: Bill Unruh @ 2004-09-29 16:10 UTC (permalink / raw)
To: linux-ppp
On Wed, 29 Sep 2004, David Ananian-Cooper wrote:
> hi
>
> i've encountered the same problem working the code while writing a plugin. i
> managed to get around it by taking a copy of the counters every few minutes
> and noting when they loop around to zero (i.e. when old_value > new_value).
> its a bit of a hack, but it seems to work for my purposes.
>
> >
> > The problem is that counters for 'bytes in' and 'bytes out' are 32 bit
> > integers, which is enough for counting data while connected via modem, but
> > really small while using pppoe or pptpd-based solutions deployed over
> > 100/1000mbit network.
You have the source code. Make the counters longs instead. Does not seem
a terribly difficult hack.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: counters overflow
2004-09-29 5:20 counters overflow Dmitry Vereschaka
2004-09-29 6:16 ` David Ananian-Cooper
2004-09-29 16:10 ` Bill Unruh
@ 2004-09-30 2:10 ` Paul Mackerras
2004-09-30 17:33 ` carlsonj
3 siblings, 0 replies; 5+ messages in thread
From: Paul Mackerras @ 2004-09-30 2:10 UTC (permalink / raw)
To: linux-ppp
Bill Unruh writes:
> You have the source code. Make the counters longs instead. Does not seem
> a terribly difficult hack.
They would need to be long long, and the problem (from my point of
view, at least) is that that changes the user/kernel ABI, which causes
all sorts of compatibility problems.
I think I will make pppd maintain the upper 32 bits of a count in
userspace, by having it wake up periodically and poll the 32-bit
counters from the kernel and see if they have wrapped.
Paul.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: counters overflow
2004-09-29 5:20 counters overflow Dmitry Vereschaka
` (2 preceding siblings ...)
2004-09-30 2:10 ` Paul Mackerras
@ 2004-09-30 17:33 ` carlsonj
3 siblings, 0 replies; 5+ messages in thread
From: carlsonj @ 2004-09-30 17:33 UTC (permalink / raw)
To: linux-ppp
Paul Mackerras writes:
> I think I will make pppd maintain the upper 32 bits of a count in
> userspace, by having it wake up periodically and poll the 32-bit
> counters from the kernel and see if they have wrapped.
Yuck. How often would you need to poll?
We solved the problem on Solaris by having the kernel implement both a
PPPIO_GETSTAT ioctl and a new PPPIO_GETSTAT64 ioctl. The former still
returns 32 bit counters to applications that want them. The latter
uses 64 bit counters. In the user space, we call PPPIO_GETSTAT64
first, and if that fails, fall back to PPPIO_GETSTAT.
I'd expect that the same sort of thing would work fine on Linux as
well.
--
James Carlson <carlsonj@workingcode.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-09-30 17:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-29 5:20 counters overflow Dmitry Vereschaka
2004-09-29 6:16 ` David Ananian-Cooper
2004-09-29 16:10 ` Bill Unruh
2004-09-30 2:10 ` Paul Mackerras
2004-09-30 17:33 ` carlsonj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).