Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jun 2013 23:17:48 +0400
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: [RFC] Migrate network statistics to PCPU counters
Message-ID:  <51D0845C.7060508@FreeBSD.org>
In-Reply-To: <20130630175357.GJ91021@kib.kiev.ua>
References:  <51CFFE71.9080802@FreeBSD.org> <20130630175357.GJ91021@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51D0845C.7060508>