[RFC] Migrate network statistics to PCPU counters

Andrey V. Elsukov ae at FreeBSD.org
Sun Jun 30 19:20:40 UTC 2013


On 30.06.2013 21:53, Konstantin Belousov wrote:
>> The second part of patches adds several helper macros to sys/counter.h
>> and net/vnet.h. The main idea is that we declare array of counter_u64_t
>> with number of elements equal to number of uint64_t elements in the
>> stats structure and use offsetof() to get access to needed counter. In
>> the same time, the stats structure used as interface with userland.
> Only reacting to the last sentence.
> 
> I think this is notoriously bad, the in-kernel interfaces and usermode ABI
> should be split.  The reuse of the structures for kernel and for interfacing
> to usermode is the reason why we cannot ensure the stability of the
> management ABI even on stable.
> 
> I suggest to not doing this, instead having the dedicated definitions for
> user mode, and also to add padding to the usermode interface for future
> extensions.

Actually each structure described above only used in the userland. In
the kernel we use arrays of counters and do fetch values for each PCPU
counter, then copy them into userland via stats structures.

-- 
WBR, Andrey V. Elsukov


More information about the freebsd-arch mailing list