Re: [PATCH 2.6] generic network statistics (was Re: [6/6]: jenkins hash for neigh / Statistics)
From: jamal <hidden>
Date: 2004-09-29 02:22:07
On Tue, 2004-09-28 at 09:33, Thomas Graf wrote:
quoted
Speaking of generic stats; i have a patch netlink ready which may need some extensions. I did post it a while back on netdev but didnt get feedback.The code looks good and I couldn't spot any errors but I'm not sure if the locking in gen_copy_[x]stats is a good thing. Shouldn't that be done earlier by the caller?
In the netsched code that became a portability issue; Dave fixed it there, so i just replicated here. If you feel like doing something clever you are welcome to submit a patch.
This prevents corruption but it allows duplicated TLVs in an skb. I suggest to make the caller have a lock on his data and only allow one dumper at the same time until the dump is complete, or at least provide a lockless variant for callers doing the locking on their own.
Reminds me:
gnet_stats needs to have TLVs embedded in it.
bytes,drops, packets are generic enough; others are not.
So if we add a length field then we can add TLVs for things like
QSTATS = { qlen, backlog} etc.
This means we could then allow for adding a lot of different
stats. A big lesson from current tc_stats.
cheers,
jamal