From 03456d981b4f5ddabb409d4abe9d31f5dd451c2d Mon Sep 17 00:00:00 2001 From: yushi Date: Mon, 23 Sep 2024 18:58:11 +0800 Subject: [PATCH] net/core: Replace driver version to be kernel version --- kernel.spec | 5 +- ...-driver-version-to-be-kernel-version.patch | 77 +++++++++++++++++++ series.conf | 1 + 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 patches/0760-net-core-Replace-driver-version-to-be-kernel-version.patch diff --git a/kernel.spec b/kernel.spec index c1dbcb55..256b0141 100644 --- a/kernel.spec +++ b/kernel.spec @@ -32,7 +32,7 @@ Name: kernel Version: 4.19.90 -Release: %{hulkrelease}.0295 +Release: %{hulkrelease}.0296 Summary: Linux Kernel License: GPLv2 URL: http://www.kernel.org/ @@ -850,6 +850,9 @@ fi %changelog +* Tue Sep 23 2024 yushi - 4.19.90-2409.4.0.0296 +- net/core: Replace driver version to be kernel version + * Tue Sep 17 2024 chenyi - 4.19.90-2409.4.0.0295 - !11557 xhci: Fix Panther point NULL pointer deref at full-speed re-enumeration - xhci: Fix Panther point NULL pointer deref at full-speed re-enumeration diff --git a/patches/0760-net-core-Replace-driver-version-to-be-kernel-version.patch b/patches/0760-net-core-Replace-driver-version-to-be-kernel-version.patch new file mode 100644 index 00000000..b852d759 --- /dev/null +++ b/patches/0760-net-core-Replace-driver-version-to-be-kernel-version.patch @@ -0,0 +1,77 @@ +From 61f424197f0a6b7eb38f3efdb7573fd69745c467 Mon Sep 17 00:00:00 2001 +From: Leon Romanovsky +Date: Mon, 27 Jan 2020 09:20:28 +0200 +Subject: [PATCH] net/core: Replace driver version to be kernel version + +driver inclusion +category: feature +bugzilla: https://gitee.com/openeuler/community-issue/issues/IANGOU?from=project-issue + +---------------------------------------------------------------------- + +In order to stop useless driver version bumps and unify output +presented by ethtool -i, let's set default version string. + +As Linus said in [1]: "Things are supposed to be backwards and +forwards compatible, because we don't accept breakage in user +space anyway. So versioning is pointless, and only causes +problems." + +They cause problems when users start to see version changes +and expect specific set of features which will be different +for stable@, vanilla and distribution kernels. + +Distribution kernels are based on some kernel version with extra +patches on top, for example, in RedHat world this "extra" is a lot +and for them your driver version say nothing. Users who run vanilla +kernels won't use driver version information too, because running +such kernels requires knowledge and understanding. + +Another set of problems are related to difference in versioning scheme +and such doesn't allow to write meaningful automation which will work +sanely on all ethtool capable devices. + +Before this change: +[leonro@erver ~]$ ethtool -i eth0 +driver: virtio_net +version: 1.0.0 +After this change and once ->version assignment will be deleted +from virtio_net: +[leonro@server ~]$ ethtool -i eth0 +driver: virtio_net +version: 5.5.0-rc6+ + +Link: https://lore.kernel.org/ksummit-discuss/CA+55aFx9A=5cc0QZ7CySC4F2K7eYaEfzkdYEc9JaNgCcV25=rg@mail.gmail.com/ +Link: https://lore.kernel.org/linux-rdma/20200122152627.14903-1-michal.kalderon@marvell.com/T/#md460ff8f976c532a89d6860411c3c50bb811038b +Link: https://lore.kernel.org/linux-rdma/20200127060835.GA570@unicorn.suse.cz +Signed-off-by: Leon Romanovsky +Acked-by: Shannon Nelson +Signed-off-by: David S. Miller +Signed-off-by: yushi +--- + net/ethtool/ioctl.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c +index 4db9512fe..e53f5a83b 100644 +--- a/net/ethtool/ioctl.c ++++ b/net/ethtool/ioctl.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -851,6 +852,7 @@ static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, + const struct ethtool_ops *ops = dev->ethtool_ops; + + memset(&info, 0, sizeof(info)); ++ strlcpy(info.version, UTS_RELEASE, sizeof(info.version)); + info.cmd = ETHTOOL_GDRVINFO; + if (ops->get_drvinfo) { + ops->get_drvinfo(dev, &info); +-- +2.27.0 + diff --git a/series.conf b/series.conf index b3b6c33c..c629a7d3 100644 --- a/series.conf +++ b/series.conf @@ -757,3 +757,4 @@ patches/0756-crypto-hisilicon-Add-value-profile-support-for-kerne.patch patches/0757-Revert-genirq-Increase-the-number-of-IRQ-descriptors.patch patches/0758-spi-hisi-sfc-v3xx-Return-IRQ_NONE-if-no-interrupts-w.patch patches/0759-scsi-hisi_sas-Allocate-DFX-memory-during-dump-trigge.patch +patches/0760-net-core-Replace-driver-version-to-be-kernel-version.patch -- Gitee