From: Ben Greear <greearb@candelatech.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] macvlan: lockless tx path
Date: Thu, 11 Nov 2010 09:20:53 -0800 [thread overview]
Message-ID: <4CDC25F5.7010501@candelatech.com> (raw)
In-Reply-To: <1289494618.17691.1498.camel@edumazet-laptop>
On 11/11/2010 08:56 AM, Eric Dumazet wrote:
> Le jeudi 11 novembre 2010 à 08:40 -0800, Ben Greear a écrit :
>
>> So, they assume counters are exactly 32 or 64 bits.
>> Your example of the 36-bit counter would break their
>> assumptions of 32 or 64 bits.
>>
>
> They 'assume'. I am not. How do you handle counters that suddenly go to
> 0 ?
I've shown you my algorithm that requires one to know the counter
width, and in response you offered on that will work with 32 OR 64 bits,
as long as you make some assumptions.
If you have an algorithm that can properly deal with wrapped counters of
arbitrary bits, then post it.
As for counters that go to zero, if the previous value was > 0, then
it was a wrap. There is a reason Dave won't let anyone add a patch to
clear network counters. If the network device was removed and came back,
then you must listen for those events and take proper precautions (set
prev to 0 before sampling any counters, for instance).
>> I agree that you can guess if the counter is 32 or 64, at least with today's
>> hardware and relatively normal poll times, and the requirement that the
>> counters can ONLY be 32 or 64 bits. I still consider it a kludge to
>> return 32 bit counters in stats64, however. Would you consider
>> a patch to have netlink pay attention to whether the stats are 32 or
>> 64 (based on a flag returned from dev_get_stats perhaps)?
>
> So what ? How is it going to help /proc/net/dev users (most apps use it)
At least they will have an opportunity to use a better defined API
if they wish. And, if you only want stats for one interface, and
you have 4000 VLANs in the system, reading /proc/net/dev seems quite
inefficient.
> Could you please adapt your software, and not adapt linux to your
> needs ? Dont your software runs on linux 2.6.32 ?
Yes, I used to carry a patch that allowed direct access to the netdev_stats,
and I'd fall back to parsing /proc/net/dev on standard kernels. I've now
moved to using netlink API as that seems the preferred method going
forward and allows the granularity (ie, get stats for a single device)
that I prefer.
And, I'll certainly keep trying to improve Linux, because if it helps
my needs, it may help others. If it causes harm to others, then hopefully
someone will notice and reject my patch or help me to see how to make
it better.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2010-11-11 17:20 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
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 [this message]
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=4CDC25F5.7010501@candelatech.com \
--to=greearb@candelatech.com \
--cc=eric.dumazet@gmail.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;
as well as URLs for NNTP newsgroup(s).