[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190807063410.GF2332@nanopsycho.orion>
Date: Wed, 7 Aug 2019 08:34:10 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: netdev@...r.kernel.org, Vivien Didelot <vivien.didelot@...il.com>,
f.fainelli@...il.com, andrew@...n.ch, davem@...emloft.net,
linville@...hat.com, cphealy@...il.com
Subject: Re: [PATCH ethtool] ethtool: dump nested registers
Tue, Aug 06, 2019 at 07:20:02AM CEST, mkubecek@...e.cz wrote:
>On Mon, Aug 05, 2019 at 10:52:16AM -0400, Vivien Didelot wrote:
>> Hi Michal!
>>
>> On Mon, 5 Aug 2019 10:04:48 +0200, Michal Kubecek <mkubecek@...e.cz> wrote:
>> > On Fri, Aug 02, 2019 at 03:34:54PM -0400, Vivien Didelot wrote:
>> > > Usually kernel drivers set the regs->len value to the same length as
>> > > info->regdump_len, which was used for the allocation. In case where
>> > > regs->len is smaller than the allocated info->regdump_len length,
>> > > we may assume that the dump contains a nested set of registers.
>> > >
>> > > This becomes handy for kernel drivers to expose registers of an
>> > > underlying network conduit unfortunately not exposed to userspace,
>> > > as found in network switching equipment for example.
>> > >
>> > > This patch adds support for recursing into the dump operation if there
>> > > is enough room for a nested ethtool_drvinfo structure containing a
>> > > valid driver name, followed by a ethtool_regs structure like this:
>> > >
>> > > 0 regs->len info->regdump_len
>> > > v v v
>> > > +--------------+-----------------+--------------+-- - --+
>> > > | ethtool_regs | ethtool_drvinfo | ethtool_regs | |
>> > > +--------------+-----------------+--------------+-- - --+
>> > >
>> > > Signed-off-by: Vivien Didelot <vivien.didelot@...il.com>
>> > > ---
>> >
>> > I'm not sure about this approach. If these additional objects with their
>> > own registers are represented by a network device, we can query their
>> > registers directly. If they are not (which, IIUC, is the case in your
>> > use case), we should use an appropriate interface. AFAIK the CPU ports
>> > are already represented in devlink, shouldn't devlink be also used to
>> > query their registers?
>>
>> Yet another interface wasn't that much appropriate for DSA, making the
>> stack unnecessarily complex.
>
>AFAICS, there is already devlink support in dsa and CPU ports are
>presented as devlink ports. So it wouldn't be a completely new
>interface.
I agree that since we have cpu devlink-port object, we should use this
object to carry info of it. Not to "abuse" netdevice of front panel
ports. We already have devlink regions for the purpose of binary dumps.
Currently they are per-devlink, but it should be easy to extend them
per-devlink-port.
Similar to the statistics. I think that they should go to devlink-port
object too.
>
>> In fact we are already glueing the statistics of the CPU port into the
>> master's ethtool ops (both physical ports are wired together).
>
>The ethtool statistics (in general) are one big mess, I don't think it's
>an example worth following; rather one showing us what to avoid.
>
>> Adding support for nested registers dump in ethtool makes it simple to
>> (pretty) dump CPU port's registers without too much userspace
>> addition.
>
>It is indeed convenient for pretty print - but very hard to use for any
>automated processing. My point is that CPU port is not represented by
>a network device but it is already represented by a devlink port so that
>it makes much more sense to tie its register dump to that object than to
>add add it to register dump of port's master.
>
>In the future, I would like to transform the ethtool register dump from
>current opaque block of data to an actual dump of registers. It is
>unfortunate that drivers are already mixing information specific to
>a network device with information common for the whole physical device.
>Adding more data which is actually related to a different object would
>only make things worse.
>
>Michal Kubecek
Powered by blists - more mailing lists