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]
Message-ID: <20190413184246.GA25980@lunn.ch>
Date:   Sat, 13 Apr 2019 20:42:46 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Igor Russkikh <Igor.Russkikh@...antia.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Nikita Danilov <Nikita.Danilov@...antia.com>,
        Dmitry Bogdanov <Dmitry.Bogdanov@...antia.com>,
        Yana Esina <yana.esina@...antia.com>
Subject: Re: [PATCH netnext 02/16] net: aquantia: implement hwmon api for
 chip temperature

On Sat, Apr 13, 2019 at 06:27:51PM +0000, Igor Russkikh wrote:
> 
> >> +	devm_hwmon_device_register_with_groups(&aq_nic->pdev->dev,
> >> +					       ndev->name,
> >> +					       dev_get_drvdata(&pdev->dev),
> >> +					       aq_dev_groups);
> >> +
> > 
> > You should be using devm_hwmon_device_register_with_info().
> > 
> > I'm not sure how good an idea it is use nder->name. systemd is going
> > to rename the device, so you have a sensor called eth0, and the
> > interface called enp3s0. You might be better to use the pci bus
> > address, which is fixed, or add code for the rename notifier, so you
> > can destroy and recreate the hwmon device when the interface is
> > renamed.
> 
> Thanks for the suggestion, I'll investigate.
> On my current system I however see it is named correctly after interface rename,
> like 'enp1s0-pci-0100'.

Interesting.

So you register the hwmon device after registering the netdev. So it
could be on your system that systemd has already renamed the interface
by the time you register the hwmon device. But i don't think there is
any guarantee about this.

You could also try

ip link set enp1s0-pci-0100 name eth42

to illustrate the point.

   Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ