Re: [PATCH net-next v1] net/core: Replace driver version to be kernel version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 1/25/2020 8:14 AM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> 
> In order to stop useless driver version bumps and unify output
> presented by ethtool -i, let's overwrite the version string.
> 
> Before this change:
> [leonro@erver ~]$ ethtool -i eth0
> driver: virtio_net
> version: 1.0.0
> After this change:
> [leonro@server ~]$ ethtool -i eth0
> driver: virtio_net
> version: 5.5.0-rc6+
> 
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>> ---
>  Changelog:
>  v1: Resend per-Dave's request
>      https://lore.kernel.org/linux-rdma/20200125.101311.1924780619716720495.davem@xxxxxxxxxxxxx
>      No changes at all and applied cleanly on top of "3333e50b64fe Merge branch 'mlxsw-Offload-TBF'"
>  v0: https://lore.kernel.org/linux-rdma/20200123130541.30473-1-leon@xxxxxxxxxx

There does not appear to be any explanation why we think this is a good
idea for *all* drivers, and not just the ones that are purely virtual?

Are you not concerned that this is ABI and that specific userland may be
relying on a specific info format and we could now be breaking their
version checks? I do not disagree that the version is not particularly
useful for in-tree kernel, but this is ABI, and breaking user-space is
usually a source of support questions.

> ---
>  net/ethtool/ioctl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index 182bffbffa78..a403decacb6d 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -17,6 +17,7 @@
>  #include <linux/phy.h>
>  #include <linux/bitops.h>
>  #include <linux/uaccess.h>
> +#include <linux/vermagic.h>
>  #include <linux/vmalloc.h>
>  #include <linux/sfp.h>
>  #include <linux/slab.h>
> @@ -666,6 +667,8 @@ static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev,
>  		return -EOPNOTSUPP;
>  	}
> 
> +	strlcpy(info.version, UTS_RELEASE, sizeof(info.version));
> +
>  	/*
>  	 * this method of obtaining string set info is deprecated;
>  	 * Use ETHTOOL_GSSET_INFO instead.
> --
> 2.24.1
> 

-- 
Florian



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux