lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 6 Aug 2019 13:24:38 -0400
From:   Vivien Didelot <vivien.didelot@...il.com>
To:     Michal Kubecek <mkubecek@...e.cz>
Cc:     netdev@...r.kernel.org, f.fainelli@...il.com, andrew@...n.ch,
        davem@...emloft.net, linville@...hat.com, cphealy@...il.com
Subject: Re: [PATCH ethtool] ethtool: dump nested registers

Hi Michal,

On Tue, 6 Aug 2019 07:20:02 +0200, Michal Kubecek <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.
> 
> > 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.

How would that be presented to userspace? The pretty printing for some
DSA switch ports (e.g. mv88e6xxx) are already added in ethtool. Is there
a devlink-ethtool glue of some kind, or should the pretty printing be
duplicated in yet another tool? I'd prefer to avoid the latter...

> 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.

I totally understand and I'm interested to follow this work.


Thanks,

	Vivien

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ