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] [day] [month] [year] [list]
Message-ID: <YJ2We1T+34oj8Mm1@lunn.ch>
Date:   Thu, 13 May 2021 23:13:31 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Dario Binacchi <dariobin@...ero.it>
Cc:     linux-kernel@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Marc Kleine-Budde <mkl@...gutronix.de>,
        Oliver Hartkopp <socketcan@...tkopp.net>,
        Tong Zhang <ztong0001@...il.com>,
        Vincent Mailhol <mailhol.vincent@...adoo.fr>,
        Wolfgang Grandegger <wg@...ndegger.com>,
        YueHaibing <yuehaibing@...wei.com>,
        Zhang Qilong <zhangqilong3@...wei.com>,
        linux-can@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v2 1/2] can: c_can: add ethtool support

On Thu, May 13, 2021 at 09:36:37PM +0200, Dario Binacchi wrote:
> With commit 132f2d45fb23 ("can: c_can: add support to 64 message objects")
> the number of message objects used for reception / transmission depends
> on FIFO size.
> The ethtools API support allows you to retrieve this info. Driver info
> has been added too.

Hi Dario

Nice to see the API being re-used for something other than Ethernet.

> +static void c_can_get_drvinfo(struct net_device *netdev,
> +			      struct ethtool_drvinfo *info)
> +{
> +	struct c_can_priv *priv = netdev_priv(netdev);
> +	struct platform_device	*pdev = to_platform_device(priv->device);
> +
> +	strscpy(info->driver, "c_can", sizeof(info->driver));
> +	strscpy(info->version, "1.0", sizeof(info->version));

version is pretty meaningless. This driver could be backported into
some enterprise kernel with a huge number of patches. Or more likely,
some in car infotainment kernel with a lot of vendor patches. Lots of
things around the driver change, but it still tells you version
1.0. So we don't recommend filling this in. The ethtool core will then
fill the version what kernel the driver is actually being used in:

https://elixir.bootlin.com/linux/latest/source/net/ethtool/ioctl.c#L706

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ