[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YlQC2NW5JrnvuN10@nanopsycho>
Date: Mon, 11 Apr 2022 12:28:40 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Michael Guralnik <michaelgur@...dia.com>, netdev@...r.kernel.org,
jiri@...dia.com, ariela@...dia.com, maorg@...dia.com,
saeedm@...dia.com, moshe@...dia.com
Subject: Re: [RFC PATCH net-next 0/2] devlink: Add port stats
Fri, Apr 08, 2022 at 05:16:38AM CEST, kuba@...nel.org wrote:
>On Thu, 7 Apr 2022 11:40:48 +0300 Michael Guralnik wrote:
>> This patch set adds port statistics to the devlink port object.
>> It allows device drivers to dynamically attach and detach counters from a
>> devlink port object.
>
>The challenge in defining APIs for stats is not in how to wrap a free
>form string in a netlink message but how do define values that have
>clear semantics and are of value to the user.
>
>Start from that, discuss what you have with the customer who requested
>the feature. Then think about the API.
>
>I have said this multiple times to multiple people on your team.
>
>> The approach of adding object-attached statistics is already supported for trap
>> with traffic statistics and for the dev object with reload statistics.
>
>That's an entirely false comparison.
The trap stats are there already, why do you thing it is a "false
comparison" to that?
They use DEVLINK_ATTR_STATS attribute to carry the stats nest and then:
DEVLINK_ATTR_STATS_RX_PACKETS, /* u64 */
DEVLINK_ATTR_STATS_RX_BYTES, /* u64 */
DEVLINK_ATTR_STATS_RX_DROPPED, /* u64 */
I think that the semantics of these are quite clear.
>
>> For the port object, this will allow the device driver to expose and dynamicly
>> control a set of metrics related to the port.
>> Currently we add support only for counters, but later API extensions can be made
>> to support histograms or configurable counters.
>>
>> The statistics are exposed to the user with the port get command.
>>
>> Example:
>> # devlink -s port show
>> pci/0000:00:0b.0/65535: type eth netdev eth1 flavour physical port 0 splittable false
>> stats:
>> counter1 235
>> counter2 18
Powered by blists - more mailing lists