public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ben Greear <greearb@candelatech.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] macvlan: lockless tx path
Date: Thu, 11 Nov 2010 00:36:24 +0100	[thread overview]
Message-ID: <1289432184.17691.141.camel@edumazet-laptop> (raw)
In-Reply-To: <4CDB226A.8080903@candelatech.com>

Le mercredi 10 novembre 2010 à 14:53 -0800, Ben Greear a écrit :

> I did similar, and then wrote extra code to detect a 64-bit kernel and if
> so assume that the counters wrap at 64 bits so I didn't have to poll so
> often to make sure I didn't miss a wrap for a 10G NIC.  If instead one wraps at 33
> bits and the other at 36, there is no way for me to deal with the wrap
> properly w/out explicitly knowing about that 33 and 36.
> 

How do you define 'wrap around' ? Maybe your definition is wrong.

> If the old 32-bit counters in /proc/net/dev instead had a driver that
> managed to wrap them at 28 bits, I can't see how your application could
> have worked properly, so you must have been assuming that the kernel would
> always return a full 32-bit counter.

I suggest you take a look at various SNMP applications that handle this
just fine. RRD for example. You can patch your favorite driver to cap
the stats to 37, 38, ... 31 or 30 bits, it works.

If you sample values faster than half the period, it works.

This has nothing to do with 32 or 64 bits, really.

Read RFC1230 for a good advice


	All the statistics are defined using the
        syntax Counter as 32 bit wrap around
        counters.  Thus, if an interface's
        hardware chip set maintains these
        statistics in 16-bit counters, then the
        agent must read the hardware's counters
        frequently enough to prevent loss of
        significance, in order to maintain
        a 32-bit counter in software."

Yes, 16bit counters _are_ fine, even if provided in a 32bit counter, if
you read value fast enough.




  parent reply	other threads:[~2010-11-10 23:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 15:41 [PATCH] macvlan: lockless tx path Eric Dumazet
2010-11-10 17:39 ` Ben Greear
2010-11-10 17:43   ` Eric Dumazet
2010-11-10 17:53     ` Ben Greear
2010-11-10 18:18       ` Eric Dumazet
2010-11-10 18:40         ` Ben Greear
2010-11-10 20:33           ` Eric Dumazet
2010-11-10 21:04             ` Ben Hutchings
2010-11-10 21:12               ` Eric Dumazet
2010-11-10 21:53                 ` Ben Hutchings
2010-11-10 21:35             ` Ben Greear
2010-11-10 22:21               ` Eric Dumazet
2010-11-10 22:53                 ` Ben Greear
2010-11-10 23:24                   ` Eric Dumazet
2010-11-10 23:36                   ` Eric Dumazet [this message]
2010-11-10 23:46                     ` Ben Greear
2010-11-11  7:03                       ` Eric Dumazet
2010-11-11 16:40                         ` Ben Greear
2010-11-11 16:56                           ` Eric Dumazet
2010-11-11 17:20                             ` Ben Greear
2010-11-11 18:02                               ` Eric Dumazet
2010-11-11 18:13                                 ` Ben Greear
2010-11-11 18:46                                   ` Eric Dumazet
2010-11-11  7:14     ` [PATCH net-next-2.6 v2] " Eric Dumazet
2010-11-12  8:20       ` Patrick McHardy
2010-11-16 18:59         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1289432184.17691.141.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=greearb@candelatech.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox