linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/core: Replace driver version to be kernel version
@ 2020-01-23 13:05 Leon Romanovsky
  2020-01-23 14:40 ` Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Leon Romanovsky @ 2020-01-23 13:05 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski
  Cc: Leon Romanovsky, Michal Kalderon, linux-netdev, RDMA mailing list

From: Leon Romanovsky <leonro@mellanox.com>

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@mellanox.com>
---
I wanted to change to VERMAGIC_STRING, but the output doesn't
look pleasant to my taste and on my system is truncated to be
"version: 5.5.0-rc6+ SMP mod_unload modve".

After this patch, we can drop all those version assignments
from the drivers.

Inspired by nfp and hns code.
---
 net/core/ethtool.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index cd9bc67381b2..3c6fb13a78bf 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.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>
@@ -776,6 +777,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.20.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2020-01-27 17:56 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 13:05 [PATCH net-next] net/core: Replace driver version to be kernel version Leon Romanovsky
2020-01-23 14:40 ` Jakub Kicinski
2020-01-23 14:54   ` Leon Romanovsky
2020-01-23 15:17     ` Jakub Kicinski
2020-01-25  9:13 ` David Miller
2020-01-26 18:56 ` Shannon Nelson
2020-01-26 19:41   ` Leon Romanovsky
2020-01-26 20:49     ` Jakub Kicinski
2020-01-26 21:08       ` Leon Romanovsky
2020-01-26 21:17         ` Shannon Nelson
2020-01-26 21:24           ` Leon Romanovsky
2020-01-26 22:12             ` Shannon Nelson
2020-01-26 22:22               ` Michal Kubecek
2020-01-26 22:57                 ` Shannon Nelson
2020-01-27  6:08                   ` Michal Kubecek
2020-01-27  6:42                     ` Leon Romanovsky
2020-01-27  5:18                 ` Leon Romanovsky
2020-01-26 21:33         ` Jakub Kicinski
2020-01-26 22:21           ` Shannon Nelson
2020-01-27  5:34             ` Leon Romanovsky
2020-01-27  6:45               ` Leon Romanovsky
2020-01-27 14:21                 ` Jakub Kicinski
2020-01-27 15:39                   ` Leon Romanovsky
2020-01-27  5:49           ` Leon Romanovsky
2020-01-27 12:21             ` David Miller
2020-01-27 12:42               ` Leon Romanovsky
2020-01-27 12:47                 ` David Miller
2020-01-27 17:57             ` Shannon Nelson
2020-01-26 20:52     ` Shannon Nelson
2020-01-26 21:19       ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).