Clean driver, module and FW versions
Subsystems (22)
cover Clean driver, module and FW versions
From: Leon Romanovsky <[email protected]>
Change log:
v1:
* Split all FW cleanups patches to separate patches
* Fixed commit message
* Deleted odd DRV_RELDATE
* Added everyone from MAINTAINERS file
v0: https://lore.kernel.org/netdev/[email protected]
----------------------------------------------------------------------------
Hi,
This is first patchset to netdev (already sent RDMA [1] and arch/um [2]) in attempt to unify the version management for in-tree kernel code. The patches follow already accepted ethtool change [3] to set as a default linux kernel version.
It allows us to remove driver version and present to the users unified picture of driver version, which is similar to default MODULE_VERSION().
As part of this series, I deleted various creative attempts to mark absence of FW. There is no need to set "N/A" in ethtool ->fw_version field and it is enough to do not set it.
1.
The code is compile tested and passes 0-day kbuild.
2.
The proposed changes are based on commit:
2bb07f4e1d86 ("tc-testing: updated tdc tests for basic filter")
3.
WIP branch is [4].
[1] https://lore.kernel.org/linux-rdma/[email protected]/
[2] http://lists.infradead.org/pipermail/linux-um/2020-February/002913.html
[3] https://lore.kernel.org/linux-rdma/[email protected]/
[4] https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=ethtool
Thanks
Leon Romanovsky (18):
net/bond: Delete driver and module versions
net/dummy: Ditch driver and module versions
net/3com: Delete driver and module versions from 3com drivers net/adaptec: Clean driver versions
net/aeroflex: Clean ethtool_info struct assignments net/aeroflex: Don't assign FW if it is not available net/agere: Delete unneeded driver version
net/alacritech: Delete driver version
net/allwinner: Remove driver version
net/alteon: Properly report FW version
net/althera: Delete hardcoded driver version
net/amazon: Ensure that driver version is aligned to the linux kernel net/amd: Remove useless driver version
net/apm: Remove useless driver version
net/apm: Properly mark absence of FW
net/aquantia: Delete module version
net/arc: Delete driver version
net/atheros: Clean atheros code from driver version
drivers/net/bonding/bond_main.c | 6 +----- drivers/net/bonding/bonding_priv.h | 5 ++--- drivers/net/dummy.c | 3 --- drivers/net/ethernet/3com/3c509.c | 8 +------- drivers/net/ethernet/3com/3c515.c | 16 +--------------- drivers/net/ethernet/3com/3c589_cs.c | 2 -- drivers/net/ethernet/3com/typhoon.c | 1 - drivers/net/ethernet/adaptec/starfire.c | 19 +------------------ drivers/net/ethernet/aeroflex/greth.c | 2 -- drivers/net/ethernet/agere/et131x.c | 1 - drivers/net/ethernet/agere/et131x.h | 1 - drivers/net/ethernet/alacritech/slicoss.c | 3 --- drivers/net/ethernet/allwinner/sun4i-emac.c | 2 -- drivers/net/ethernet/alteon/acenic.c | 5 ++--- .../net/ethernet/altera/altera_tse_ethtool.c | 1 - drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 - drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ++--------------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 11 ----------- drivers/net/ethernet/amd/amd8111e.c | 5 +---- drivers/net/ethernet/amd/au1000_eth.c | 5 ----- drivers/net/ethernet/amd/nmclan_cs.c | 9 +++------ drivers/net/ethernet/amd/pcnet32.c | 7 ------- drivers/net/ethernet/amd/sunlance.c | 10 ---------- drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe-main.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe.h | 1 - drivers/net/ethernet/apm/xgene-v2/ethtool.c | 2 -- drivers/net/ethernet/apm/xgene-v2/main.c | 1 - drivers/net/ethernet/apm/xgene-v2/main.h | 1 - .../ethernet/apm/xgene/xgene_enet_ethtool.c | 2 -- .../net/ethernet/apm/xgene/xgene_enet_main.c | 1 - .../net/ethernet/apm/xgene/xgene_enet_main.h | 1 - .../net/ethernet/aquantia/atlantic/aq_cfg.h | 4 ---- .../ethernet/aquantia/atlantic/aq_common.h | 1 - .../ethernet/aquantia/atlantic/aq_ethtool.c | 1 - .../net/ethernet/aquantia/atlantic/aq_main.c | 1 - drivers/net/ethernet/aquantia/atlantic/ver.h | 12 ------------ drivers/net/ethernet/arc/emac.h | 1 - drivers/net/ethernet/arc/emac_arc.c | 2 -- drivers/net/ethernet/arc/emac_main.c | 1 - drivers/net/ethernet/arc/emac_rockchip.c | 2 -- drivers/net/ethernet/atheros/atl1c/atl1c.h | 1 - .../ethernet/atheros/atl1c/atl1c_ethtool.c | 2 -- .../net/ethernet/atheros/atl1c/atl1c_main.c | 5 ----- drivers/net/ethernet/atheros/atl1e/atl1e.h | 1 - .../ethernet/atheros/atl1e/atl1e_ethtool.c | 2 -- .../net/ethernet/atheros/atl1e/atl1e_main.c | 4 ---- drivers/net/ethernet/atheros/atlx/atl1.c | 6 ------ drivers/net/ethernet/atheros/atlx/atl2.c | 10 ---------- 49 files changed, 14 insertions(+), 193 deletions(-) delete mode 100644 drivers/net/ethernet/aquantia/atlantic/ver.h
PATCH 1/18 net/bond: Delete driver and module versions
From: Leon Romanovsky <[email protected]>
The in-kernel code has already unique version, which is based on Linus's tag, update the bond driver to be consistent with that version.
--- drivers/net/bonding/bond_main.c | 6 +----- drivers/net/bonding/bonding_priv.h | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-)
drivers/net/bonding/bond_main.c +1 -5
@@ -4370,7 +4370,6 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev, struct ethtool_drvinfo *drvinfo) {strlcpy (drvinfo->driver,DRV_NAME ,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version,DRV_VERSION ,sizeof (drvinfo->version));snprintf (drvinfo->fw_version,sizeof (drvinfo->fw_version),"%d" ,BOND_ABI_VERSION ); }
@@ -5008,8 +5007,6 @@ static int __init bonding_init(void)int i;int res; -pr_info ("%s" , bond_version); - res =bond_check_params (&bonding_defaults);if (res) goto out;
@@ -5064,6 +5061,5 @@ static void __exit bonding_exit(void)module_init (bonding_init);module_exit (bonding_exit);MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION ); -MODULE_DESCRIPTION (DRV_DESCRIPTION ", v" DRV_VERSION ); +MODULE_DESCRIPTION (DRV_DESCRIPTION );MODULE_AUTHOR ("Thomas Davis, [email protected] and many others" );
drivers/net/bonding/bonding_priv.h +2 -3
@@ -14,12 +14,11 @@#ifndef _BONDING_PRIV_H#define _BONDING_PRIV_H +#include <linux/vermagic.h> -#define DRV_VERSION "3.7.1" -#define DRV_RELDATE "April 27, 2011"#define DRV_NAME "bonding"#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" -#define bond_version DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n" +#define bond_version DRV_DESCRIPTION ": v" UTS_RELEASE "\n"#endif
PATCH 2/18 net/dummy: Ditch driver and module versions
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Delete constant driver and module versions in favor of standard global version which is unique to whole kernel.
--- drivers/net/dummy.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/dummy.c +0 -3
@@ -42,7 +42,6 @@#include <linux/u64_stats_sync.h> #define DRV_NAME "dummy" -#define DRV_VERSION "1.0"static int numdummies =1 ;
@@ -104,7 +103,6 @@ static void dummy_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) {strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version)); }static const struct ethtool_ops dummy_ethtool_ops = {
@@ -212,4 +210,3 @@ module_init(dummy_init_module);module_exit (dummy_cleanup_module);MODULE_LICENSE ("GPL" );MODULE_ALIAS_RTNL_LINK (DRV_NAME ); -MODULE_VERSION (DRV_VERSION );
--
2.24.1
PATCH 3/18 net/3com: Delete driver and module versions from 3com drivers
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
There is no need to mislead users by providing different versions for driver, ethtool and modules. Delete driver assignments and let use the default one.
--- drivers/net/ethernet/3com/3c509.c | 8 +------- drivers/net/ethernet/3com/3c515.c | 16 +--------------- drivers/net/ethernet/3com/3c589_cs.c | 2 -- drivers/net/ethernet/3com/typhoon.c | 1 - 4 files changed, 2 insertions(+), 25 deletions(-)
drivers/net/ethernet/3com/3c509.c +1 -7
@@ -60,8 +60,6 @@*/ #define DRV_NAME "3c509" -#define DRV_VERSION "1.20" -#define DRV_RELDATE "04Feb2008"/* A few values that may be tweaked. */
@@ -87,13 +85,12 @@#include <linux/device.h> #include <linux/eisa.h> #include <linux/bitops.h> +#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h> #include <asm/irq.h> -static char version[] =DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " [email protected]\n" ; -#ifdef EL3_DEBUG static int el3_debug =EL3_DEBUG ;#else
@@ -547,8 +544,6 @@ static int el3_common_init(struct net_device *dev) dev->name, dev->base_addr, if_names[(dev->if_port &0x03 )], dev->dev_addr, dev->irq); -if (el3_debug >0 ) -pr_info ("%s" , version);return 0 ; }
@@ -1143,7 +1138,6 @@ el3_netdev_set_ecmd(struct net_device *dev,static void el3_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) {strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version)); } static int el3_get_link_ksettings(struct net_device *dev,
drivers/net/ethernet/3com/3c515.c +1 -15
@@ -22,12 +22,8 @@*/ +#include <linux/vermagic.h> #define DRV_NAME "3c515" -#define DRV_VERSION "0.99t-ac" -#define DRV_RELDATE "28-Oct-2002" - -static char *version = -DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " [email protected] and others\n" ;#define CORKSCREW 1
@@ -84,7 +80,6 @@ static int max_interrupt_work = 20;MODULE_AUTHOR ("Donald Becker <[email protected]>" );MODULE_DESCRIPTION ("3Com 3c515 Corkscrew driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION );/* "Knobs" for adjusting internal parameters. */ /* Put out somewhat more debugging messages. (0 - no msg, 1 minimal msgs). */
@@ -418,8 +413,6 @@ int init_module(void)int found =0 ;if (debug >=0 ) corkscrew_debug = debug; -if (corkscrew_debug) -pr_debug ("%s" , version);while (corkscrew_scan (-1 )) found++;return found ?0 : -ENODEV ;
@@ -429,16 +422,10 @@ int init_module(void)struct net_device *tc515_probe (int unit) {struct net_device *dev =corkscrew_scan (unit); -static int printed;if (!dev)return ERR_PTR (-ENODEV ); -if (corkscrew_debug >0 && !printed) { - printed =1 ; -pr_debug ("%s" , version); - } -return dev; }#endif /* not MODULE */
@@ -1540,7 +1527,6 @@ static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) {strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));snprintf (info->bus_info,sizeof (info->bus_info),"ISA 0x%lx" , dev->base_addr); }
drivers/net/ethernet/3com/3c589_cs.c +0 -2
@@ -23,7 +23,6 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#define DRV_NAME "3c589_cs" -#define DRV_VERSION "1.162-ac"#include <linux/module.h> #include <linux/kernel.h>
@@ -482,7 +481,6 @@ static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) {strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));snprintf (info->bus_info,sizeof (info->bus_info),"PCMCIA 0x%lx" , dev->base_addr); }
drivers/net/ethernet/3com/typhoon.c +0 -1
@@ -127,7 +127,6 @@ static const int multicast_filter_limit = 32;#include "typhoon.h" MODULE_AUTHOR ("David Dillow <[email protected]>" ); -MODULE_VERSION ("1.0" );MODULE_LICENSE ("GPL" );MODULE_FIRMWARE (FIRMWARE_NAME );MODULE_DESCRIPTION ("3Com Typhoon Family (3C990, 3CR990, and variants)" );
--
2.24.1
PATCH 1/1 net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
From: Borislav Petkov <[email protected]>
Change the include order so that MODULE_ARCH_VERMAGIC from the arch header arch/x86/include/asm/module.h gets used instead of the fallback from include/linux/vermagic.h and thus fix:
In file included from ./include/linux/module.h:30,
from drivers/net/ethernet/3com/3c515.c:56:
./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" redefined
73 | # define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
|
In file included from drivers/net/ethernet/3com/3c515.c:25:
./include/linux/vermagic.h:28: note: this is the location of the previous definition
28 | #define MODULE_ARCH_VERMAGIC ""
|
--- drivers/net/ethernet/3com/3c515.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/3com/3c515.c +1 -1
@@ -22,7 +22,6 @@*/ -#include <linux/vermagic.h> #define DRV_NAME "3c515"#define CORKSCREW 1
@@ -67,6 +66,7 @@ static int max_interrupt_work = 20;#include <linux/timer.h> #include <linux/ethtool.h> #include <linux/bitops.h> +#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h>
Signature · 7 lines
2.21.0
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteRe: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 16 lines · Borislav Petkov
From: Borislav Petkov <[email protected]>
Change the include order so that
MODULE_ARCH_VERMAGICfrom the arch headerarch/x86/include/asm/module.hgets used instead of the fallback frominclude/linux/vermagic.hand thus fix:In file included from
./include/linux/module.h:30,from drivers/net/ethernet/3com/3c515.c:56:
./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" redefined
73 | # defineMODULE_ARCH_VERMAGICMODULE_PROC_FAMILY
|
In file included fromdrivers/net/ethernet/3com/3c515.c:25:
./include/linux/vermagic.h:28: note: this is the location of the previous definition
28 | #defineMODULE_ARCH_VERMAGIC""
|
Quoted 5 lines
Fixes 6bba2e89a88c ("net/3com: Delete driver and module versions from 3com drivers")Signed-off-by Borislav Petkov <[email protected]>--- drivers/net/ethernet/3com/3c515.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Probably, this is the right change, but I have a feeling that the right solution will be inside headers itself. It is a little bit strange that both very common kernel headers like module.h and vermagic.h are location dependant.
Thanks
Quoted 29 lines
drivers/net/ethernet/3com/3c515.c +1
-2@@ -22,7 +22,6 @@*/ -#include <linux/vermagic.h> #define DRV_NAME "3c515"#define CORKSCREW 1@@ -67,6 +66,7 @@ static int max_interrupt_work = 20;#include <linux/timer.h> #include <linux/ethtool.h> #include <linux/bitops.h> +#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h> --2.21.0
--
Regards/Gruss,
Boris.
Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 4 lines · Leon Romanovsky
Probably, this is the right change, but I have a feeling that the right solution will be inside headers itself. It is a little bit strange that both very common kernel headers like
module.handvermagic.hare location dependant.
Judging by how only a couple of net drivers include vermagic.h directly, doh, of course:
drivers/net/ethernet/3com/3c509.c +0 -1
@@ -85,7 +85,6 @@#include <linux/device.h> #include <linux/eisa.h> #include <linux/bitops.h> -#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h>
drivers/net/ethernet/3com/3c515.c +0 -1
@@ -22,7 +22,6 @@*/ -#include <linux/vermagic.h> #define DRV_NAME "3c515"#define CORKSCREW 1
---
Drivers include
#include <linux/module.h>
which includes
#include <asm/module.h>
which defines the arch-specific MODULE_ARCH_VERMAGIC.
Why did you need to include vermagic.h directly? i386 builds fine with the vermagic.h includes removed or was it some other arches which needed it?
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteRe: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 42 lines · Borislav Petkov
Quoted 4 lines · Leon Romanovsky
Probably, this is the right change, but I have a feeling that the right solution will be inside headers itself. It is a little bit strange that both very common kernel headers like
module.handvermagic.hare location dependant.Judging by how only a couple of net drivers include
vermagic.hdirectly, doh, of course:drivers/net/ethernet/3com/3c509.c +0
-1@@ -85,7 +85,6 @@#include <linux/device.h> #include <linux/eisa.h> #include <linux/bitops.h> -#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h> drivers/net/ethernet/3com/3c515.c +0
-2@@ -22,7 +22,6 @@*/ -#include <linux/vermagic.h> #define DRV_NAME "3c515"#define CORKSCREW 1 ---Drivers include
#include <
linux/module.h>which includes
Quoted 7 lines
#include <
asm/module.h>which defines the arch-specific
MODULE_ARCH_VERMAGIC.Why did you need to include
vermagic.hdirectly? i386 builds fine with thevermagic.hincludes removed or was it some other arches which needed it?
I want to think that it was an outcome of some 0-day kbuild report, but I am not sure about that anymore [1].
Thanks
[1] https://lists.01.org/hyperkitty/list/[email protected]/
Quoted 8 lines
Thx.
--
Regards/Gruss,
Boris.
Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 2 lines · Leon Romanovsky
I want to think that it was an outcome of some 0-day kbuild report, but I am not sure about that anymore [1].
I pushed it here:
https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/log/?h=rc0%2b0-3c
The 0day bot will send me a mail soon. :)
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteDavid Miller
maintainerRe: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
Date: Sat, 11 Apr 2020 17:56:23 +0200
Quoted 16 lines
From: Borislav Petkov <[email protected]>
Change the include order so that
MODULE_ARCH_VERMAGICfrom the arch headerarch/x86/include/asm/module.hgets used instead of the fallback frominclude/linux/vermagic.hand thus fix:In file included from
./include/linux/module.h:30,from drivers/net/ethernet/3com/3c515.c:56:
./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" redefined
73 | # defineMODULE_ARCH_VERMAGICMODULE_PROC_FAMILY
|
In file included fromdrivers/net/ethernet/3com/3c515.c:25:
./include/linux/vermagic.h:28: note: this is the location of the previous definition
28 | #defineMODULE_ARCH_VERMAGIC""
|
Quoted 2 lines
Fixes 6bba2e89a88c ("net/3com: Delete driver and module versions from 3com drivers")Signed-off-by Borislav Petkov <[email protected]>
I'm so confused, that commit in the Fixes: tag is _removing_ code but adding new #include directives?!?!
Is vermagic.h really needed in these files?
Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 19 lines · David Miller
From: Borislav Petkov <[email protected]>
Date: Sat, 11 Apr 2020 17:56:23 +0200Quoted 16 lines
From: Borislav Petkov <[email protected]>
Change the include order so that
MODULE_ARCH_VERMAGICfrom the arch headerarch/x86/include/asm/module.hgets used instead of the fallback frominclude/linux/vermagic.hand thus fix:In file included from
./include/linux/module.h:30,from drivers/net/ethernet/3com/3c515.c:56:
./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" redefined
73 | # defineMODULE_ARCH_VERMAGICMODULE_PROC_FAMILY
|
In file included fromdrivers/net/ethernet/3com/3c515.c:25:
./include/linux/vermagic.h:28: note: this is the location of the previous definition
28 | #defineMODULE_ARCH_VERMAGIC""
|
Quoted 7 lines
Quoted 2 lines
Fixes 6bba2e89a88c ("net/3com: Delete driver and module versions from 3com drivers")Signed-off-by Borislav Petkov <[email protected]>I'm so confused, that commit in the Fixes: tag is _removing_ code but adding new #include directives?!?!
Is
vermagic.hreally needed in these files?
You are completely right, it is not needed at all in those files.
Thanks
David Miller
maintainerRe: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
From: Leon Romanovsky <[email protected]>
Date: Mon, 13 Apr 2020 07:55:55 +0300
Quoted 23 lines · David Miller
Quoted 22 lines
From: Borislav Petkov <[email protected]>
Date: Sat, 11 Apr 2020 17:56:23 +0200Quoted 18 lines
From: Borislav Petkov <[email protected]>
Change the include order so that
MODULE_ARCH_VERMAGICfrom the arch headerarch/x86/include/asm/module.hgets used instead of the fallback frominclude/linux/vermagic.hand thus fix:In file included from
./include/linux/module.h:30,from drivers/net/ethernet/3com/3c515.c:56:
./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" redefined
73 | # defineMODULE_ARCH_VERMAGICMODULE_PROC_FAMILY
|
In file included fromdrivers/net/ethernet/3com/3c515.c:25:
./include/linux/vermagic.h:28: note: this is the location of the previous definition
28 | #defineMODULE_ARCH_VERMAGIC""
|Fixes 6bba2e89a88c ("net/3com: Delete driver and module versions from 3com drivers")Signed-off-by Borislav Petkov <[email protected]>
Quoted 6 lines
Quoted 4 lines
I'm so confused, that commit in the Fixes: tag is _removing_ code but adding new #include directives?!?!
Is
vermagic.hreally needed in these files?You are completely right, it is not needed at all in those files.
Ok let's just remove it to fix this.
Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 26 lines · David Miller
From: Leon Romanovsky <[email protected]>
Date: Mon, 13 Apr 2020 07:55:55 +0300Quoted 23 lines · David Miller
Quoted 22 lines
From: Borislav Petkov <[email protected]>
Date: Sat, 11 Apr 2020 17:56:23 +0200Quoted 18 lines
From: Borislav Petkov <[email protected]>
Change the include order so that
MODULE_ARCH_VERMAGICfrom the arch headerarch/x86/include/asm/module.hgets used instead of the fallback frominclude/linux/vermagic.hand thus fix:In file included from
./include/linux/module.h:30,from drivers/net/ethernet/3com/3c515.c:56:
./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" redefined
73 | # defineMODULE_ARCH_VERMAGICMODULE_PROC_FAMILY
|
In file included fromdrivers/net/ethernet/3com/3c515.c:25:
./include/linux/vermagic.h:28: note: this is the location of the previous definition
28 | #defineMODULE_ARCH_VERMAGIC""
|Fixes 6bba2e89a88c ("net/3com: Delete driver and module versions from 3com drivers")Signed-off-by Borislav Petkov <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
I'm so confused, that commit in the Fixes: tag is _removing_ code but adding new #include directives?!?!
Is
vermagic.hreally needed in these files?You are completely right, it is not needed at all in those files.
Ok let's just remove it to fix this.
Thanks a lot.
How do you want us to handle it? Boris resend, me to send, you to fix?
Thanks
David Miller
maintainerRe: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
From: Leon Romanovsky <[email protected]>
Date: Mon, 13 Apr 2020 08:26:37 +0300
Quoted 1 line
How do you want us to handle it? Boris resend, me to send, you to fix?
Anyone other than me can do it ;-)
Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 6 lines · David Miller
From: Leon Romanovsky <[email protected]>
Date: Mon, 13 Apr 2020 08:26:37 +0300Quoted 1 line
How do you want us to handle it? Boris resend, me to send, you to fix?
Anyone other than me can do it ;-)
Ok, here's what I'm thinking: that vermagic.h is normally automatically included in the *mod.c as part of the module creation, see add_header() in modpost.c.
So then perhaps drivers should not use it directly due to the current inclusion order:
linux/module.h includes asm/module.h and that arch-specific header defines MODULE_VERMAGIC* for the respective arch.
linux/vermagic.h defines all those fallbacks for those MODULE_VERMAGIC* things and if the inclusion order is swapped - we get the redefinition warning.
Yesterday I tried the below - basically get rid of all the remaining includers of linux/vermagic.h but two are left:
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:18:#include <linux/vermagic.h> drivers/net/ethernet/netronome/nfp/nfp_main.c:17:#include <linux/vermagic.h>
because both use VERMAGIC_STRING directly.
So,
* one could either allow that and sort the inclusion order so that, for example, asm/module.h includes linux/vermagic.h and thus the fallbacks are there present.
or
* remove all uses of VERMAGIC_STRING from the drivers, add a header guard which prevents people from using it directly and leave VERMAGIC_STRING only to the internal module machinery in the kernel.
Judging by how only a handful of old drivers are even using that, perhaps not too far fetched.
In any case, this needs a maintainer decision.
Leon, if you wanna do it whatever you guys end up agreeing on, just go ahead and submit the patches - it's not like I don't have anything else on the TODO :-) Just add a Reported-by: me and that should be enough.
If you're busy too, lemme know and I'll put it on my todo then.
Thx.
drivers/net/bonding/bonding_priv.h +1 -1
@@ -14,7 +14,7 @@#ifndef _BONDING_PRIV_H#define _BONDING_PRIV_H -#include <linux/vermagic.h> +#include <generated/utsrelease.h> #define DRV_NAME "bonding"#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
drivers/net/ethernet/3com/3c509.c +0 -1
@@ -85,7 +85,6 @@#include <linux/device.h> #include <linux/eisa.h> #include <linux/bitops.h> -#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h>
drivers/net/ethernet/3com/3c515.c +0 -1
@@ -22,7 +22,6 @@*/ -#include <linux/vermagic.h> #define DRV_NAME "3c515"#define CORKSCREW 1
drivers/net/ethernet/adaptec/starfire.c +0 -1
@@ -45,7 +45,6 @@#include <asm/processor.h> /* Processor type for cache alignment. */ #include <linux/uaccess.h> #include <asm/io.h> -#include <linux/vermagic.h> /* * The current frame processor firmware fails to checksum a fragment
drivers/net/ethernet/pensando/ionic/ionic_main.c +1 -1
@@ -6,7 +6,7 @@#include <linux/module.h> #include <linux/netdevice.h> #include <linux/utsname.h> -#include <linux/vermagic.h> +#include <generated/utsrelease.h> #include "ionic.h" #include "ionic_bus.h"
drivers/power/supply/test_power.c +1 -1
@@ -16,7 +16,7 @@#include <linux/power_supply.h> #include <linux/errno.h> #include <linux/delay.h> -#include <linux/vermagic.h> +#include <generated/utsrelease.h> enum test_power_id {TEST_AC ,
net/ethtool/ioctl.c +2 -1
@@ -17,7 +17,6 @@#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>
@@ -29,6 +28,8 @@#include <net/flow_offload.h> #include <linux/ethtool_netlink.h> +#include <generated/utsrelease.h> +#include "common.h" /*
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteRe: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 42 lines · Borislav Petkov
Quoted 6 lines · David Miller
From: Leon Romanovsky <[email protected]>
Date: Mon, 13 Apr 2020 08:26:37 +0300Quoted 1 line
How do you want us to handle it? Boris resend, me to send, you to fix?
Anyone other than me can do it ;-)
Ok, here's what I'm thinking: that
vermagic.his normally automatically included in the *mod.c as part of the module creation, seeadd_header()inmodpost.c.So then perhaps drivers should not use it directly due to the current inclusion order:
linux/module.hincludesasm/module.hand that arch-specific header defines MODULE_VERMAGIC* for the respective arch.
linux/vermagic.hdefines all those fallbacks for those MODULE_VERMAGIC* things and if the inclusion order is swapped - we get the redefinition warning.Yesterday I tried the below - basically get rid of all the remaining includers of
linux/vermagic.hbut two are left:drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:18:#include <
linux/vermagic.h> drivers/net/ethernet/netronome/nfp/nfp_main.c:17:#include <linux/vermagic.h>because both use
VERMAGIC_STRINGdirectly.So,
* one could either allow that and sort the inclusion order so that, for example,
asm/module.hincludeslinux/vermagic.hand thus the fallbacks are there present.or
* remove all uses of
VERMAGIC_STRINGfrom the drivers, add a header guard which prevents people from using it directly and leaveVERMAGIC_STRINGonly to the internal module machinery in the kernel.
Quoted 8 lines
Judging by how only a handful of old drivers are even using that, perhaps not too far fetched.
In any case, this needs a maintainer decision.
Leon, if you wanna do it whatever you guys end up agreeing on, just go ahead and submit the patches - it's not like I don't have anything else on the TODO :-) Just add a Reported-by: me and that should be enough.
I broke it so I should fix and will send a patch today/tomorrow.
Thanks
Quoted 108 lines
If you're busy too, lemme know and I'll put it on my todo then.
Thx.
drivers/net/bonding/bonding_priv.h +1
-1@@ -14,7 +14,7 @@#ifndef _BONDING_PRIV_H#define _BONDING_PRIV_H -#include <linux/vermagic.h> +#include <generated/utsrelease.h> #define DRV_NAME "bonding"#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"drivers/net/ethernet/3com/3c509.c +0
-1@@ -85,7 +85,6 @@#include <linux/device.h> #include <linux/eisa.h> #include <linux/bitops.h> -#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h> drivers/net/ethernet/3com/3c515.c +0
-1@@ -22,7 +22,6 @@*/ -#include <linux/vermagic.h> #define DRV_NAME "3c515"#define CORKSCREW 1drivers/net/ethernet/adaptec/starfire.c +0
-1@@ -45,7 +45,6 @@#include <asm/processor.h> /* Processor type for cache alignment. */ #include <linux/uaccess.h> #include <asm/io.h> -#include <linux/vermagic.h> /* * The current frame processor firmware fails to checksum a fragment drivers/net/ethernet/pensando/ionic/ionic_main.c +1
-1@@ -6,7 +6,7 @@#include <linux/module.h> #include <linux/netdevice.h> #include <linux/utsname.h> -#include <linux/vermagic.h> +#include <generated/utsrelease.h> #include "ionic.h" #include "ionic_bus.h" drivers/power/supply/test_power.c +1
-1@@ -16,7 +16,7 @@#include <linux/power_supply.h> #include <linux/errno.h> #include <linux/delay.h> -#include <linux/vermagic.h> +#include <generated/utsrelease.h> enum test_power_id {TEST_AC ,net/ethtool/ioctl.c +2
-2@@ -17,7 +17,6 @@#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> @@ -29,6 +28,8 @@#include <net/flow_offload.h> #include <linux/ethtool_netlink.h> +#include <generated/utsrelease.h> +#include "common.h" /* -- Regards/Gruss,
Boris.
Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Quoted 46 lines · Leon Romanovsky
Quoted 45 lines · Borislav Petkov
Quoted 6 lines · David Miller
From: Leon Romanovsky <[email protected]>
Date: Mon, 13 Apr 2020 08:26:37 +0300Quoted 1 line
How do you want us to handle it? Boris resend, me to send, you to fix?
Anyone other than me can do it ;-)
Ok, here's what I'm thinking: that
vermagic.his normally automatically included in the *mod.c as part of the module creation, seeadd_header()inmodpost.c.So then perhaps drivers should not use it directly due to the current inclusion order:
linux/module.hincludesasm/module.hand that arch-specific header defines MODULE_VERMAGIC* for the respective arch.
linux/vermagic.hdefines all those fallbacks for those MODULE_VERMAGIC* things and if the inclusion order is swapped - we get the redefinition warning.Yesterday I tried the below - basically get rid of all the remaining includers of
linux/vermagic.hbut two are left:drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:18:#include <
linux/vermagic.h> drivers/net/ethernet/netronome/nfp/nfp_main.c:17:#include <linux/vermagic.h>because both use
VERMAGIC_STRINGdirectly.So,
* one could either allow that and sort the inclusion order so that, for example,
asm/module.hincludeslinux/vermagic.hand thus the fallbacks are there present.or
* remove all uses of
VERMAGIC_STRINGfrom the drivers, add a header guard which prevents people from using it directly and leaveVERMAGIC_STRINGonly to the internal module machinery in the kernel.Judging by how only a handful of old drivers are even using that, perhaps not too far fetched.
Quoted 7 lines
Quoted 5 lines
In any case, this needs a maintainer decision.
Leon, if you wanna do it whatever you guys end up agreeing on, just go ahead and submit the patches - it's not like I don't have anything else on the TODO :-) Just add a Reported-by: me and that should be enough.
I broke it so I should fix and will send a patch today/tomorrow.
ok, the patches are here, will wait for the kbuild results and will send.
https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=vermagic
Thanks
Quoted 111 lines
Thanks
Quoted 108 lines
If you're busy too, lemme know and I'll put it on my todo then.
Thx.
drivers/net/bonding/bonding_priv.h +1
-1@@ -14,7 +14,7 @@#ifndef _BONDING_PRIV_H#define _BONDING_PRIV_H -#include <linux/vermagic.h> +#include <generated/utsrelease.h> #define DRV_NAME "bonding"#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"drivers/net/ethernet/3com/3c509.c +0
-1@@ -85,7 +85,6 @@#include <linux/device.h> #include <linux/eisa.h> #include <linux/bitops.h> -#include <linux/vermagic.h> #include <linux/uaccess.h> #include <asm/io.h> drivers/net/ethernet/3com/3c515.c +0
-1@@ -22,7 +22,6 @@*/ -#include <linux/vermagic.h> #define DRV_NAME "3c515"#define CORKSCREW 1drivers/net/ethernet/adaptec/starfire.c +0
-1@@ -45,7 +45,6 @@#include <asm/processor.h> /* Processor type for cache alignment. */ #include <linux/uaccess.h> #include <asm/io.h> -#include <linux/vermagic.h> /* * The current frame processor firmware fails to checksum a fragment drivers/net/ethernet/pensando/ionic/ionic_main.c +1
-1@@ -6,7 +6,7 @@#include <linux/module.h> #include <linux/netdevice.h> #include <linux/utsname.h> -#include <linux/vermagic.h> +#include <generated/utsrelease.h> #include "ionic.h" #include "ionic_bus.h" drivers/power/supply/test_power.c +1
-1@@ -16,7 +16,7 @@#include <linux/power_supply.h> #include <linux/errno.h> #include <linux/delay.h> -#include <linux/vermagic.h> +#include <generated/utsrelease.h> enum test_power_id {TEST_AC ,net/ethtool/ioctl.c +2
-2@@ -17,7 +17,6 @@#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> @@ -29,6 +28,8 @@#include <net/flow_offload.h> #include <linux/ethtool_netlink.h> +#include <generated/utsrelease.h> +#include "common.h" /* -- Regards/Gruss,
Boris.
PATCH 4/18 net/adaptec: Clean driver versions
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Delete useless driver version in favor of default ones.
--- drivers/net/ethernet/adaptec/starfire.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/net/ethernet/adaptec/starfire.c +1 -18
@@ -27,8 +27,6 @@*/ #define DRV_NAME "starfire" -#define DRV_VERSION "2.1" -#define DRV_RELDATE "July 6, 2008"#include <linux/interrupt.h> #include <linux/module.h>
@@ -47,6 +45,7 @@#include <asm/processor.h> /* Processor type for cache alignment. */ #include <linux/uaccess.h> #include <asm/io.h> +#include <linux/vermagic.h> /* * The current frame processor firmware fails to checksum a fragment
@@ -165,15 +164,9 @@ static int rx_copybreak /* = 0 */;#define FIRMWARE_RX "adaptec/starfire_rx.bin"#define FIRMWARE_TX "adaptec/starfire_tx.bin" -/* These identify the driver base version and may not be removed. */ -static const char version[] = -KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <[email protected]>\n" -" (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n" ; -MODULE_AUTHOR ("Donald Becker <[email protected]>" );MODULE_DESCRIPTION ("Adaptec Starfire Ethernet driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION );MODULE_FIRMWARE (FIRMWARE_RX );MODULE_FIRMWARE (FIRMWARE_TX );
@@ -654,13 +647,6 @@ static int starfire_init_one(struct pci_dev *pdev,int drv_flags, io_size;int boguscnt; -/* when built into the kernel, we only print version if device is found */ -#ifndef MODULE -static int printed_version; -if (!printed_version++) -printk (version); -#endif -if (pci_enable_device (pdev))return -EIO ;
@@ -1853,7 +1839,6 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) {struct netdev_private *np =netdev_priv (dev);strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (np->pci_dev),sizeof (info->bus_info)); }
@@ -2073,8 +2058,6 @@ static int __init starfire_init (void) {/* when a module, this is printed whether or not devices are found in probe */ #ifdef MODULE -printk (version); - printk(KERN_INFO DRV_NAME ": polling (NAPI) enabled\n");#endif
--
2.24.1
PATCH 5/18 net/aeroflex: Clean ethtool_info struct assignments
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
If FW version is not available, it is enough to leave that field as empty, there is no need to write N/A.
The driver version is replaced in favor of generally available in-tree variant.
--- drivers/net/ethernet/aeroflex/greth.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/aeroflex/greth.c +0 -1
@@ -1114,7 +1114,6 @@ static void greth_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *instrlcpy (info->driver,dev_driver_string (greth->dev),sizeof (info->driver)); -strlcpy (info->version,"revision: 1.0" ,sizeof (info->version));strlcpy (info->bus_info, greth->dev->bus->name,sizeof (info->bus_info));strlcpy (info->fw_version,"N/A" ,sizeof (info->fw_version)); }
--
2.24.1
PATCH 6/18 net/aeroflex: Don't assign FW if it is not available
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
If FW version is not available, it is enough to leave that field as empty, there is no need to write N/A.
--- drivers/net/ethernet/aeroflex/greth.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/aeroflex/greth.c +0 -1
@@ -1115,7 +1115,6 @@ static void greth_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *instrlcpy (info->driver,dev_driver_string (greth->dev),sizeof (info->driver));strlcpy (info->bus_info, greth->dev->bus->name,sizeof (info->bus_info)); -strlcpy (info->fw_version,"N/A" ,sizeof (info->fw_version)); }static void greth_get_regs (struct net_device *dev,struct ethtool_regs *regs,void *p)
PATCH 7/18 net/agere: Delete unneeded driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
There is no need in driver version for in-tree kernel code.
--- drivers/net/ethernet/agere/et131x.c | 1 - drivers/net/ethernet/agere/et131x.h | 1 - 2 files changed, 2 deletions(-)
drivers/net/ethernet/agere/et131x.c +0 -1
@@ -2958,7 +2958,6 @@ static void et131x_get_drvinfo(struct net_device *netdev,struct et131x_adapter *adapter =netdev_priv (netdev);strlcpy (info->driver,DRIVER_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRIVER_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (adapter->pdev),sizeof (info->bus_info)); }
drivers/net/ethernet/agere/et131x.h +0 -1
@@ -46,7 +46,6 @@*/ #define DRIVER_NAME "et131x" -#define DRIVER_VERSION "v2.0"/* EEPROM registers */
--
2.24.1
PATCH 8/18 net/alacritech: Delete driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Use standard variant of the driver version.
--- drivers/net/ethernet/alacritech/slicoss.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ethernet/alacritech/slicoss.c +0 -3
@@ -26,7 +26,6 @@#include "slic.h" #define DRV_NAME "slicoss" -#define DRV_VERSION "1.0"static const struct pci_device_id slic_id_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_ALACRITECH,
@@ -1533,7 +1532,6 @@ static void slic_get_drvinfo(struct net_device *dev,struct slic_device *sdev =netdev_priv (dev);strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (sdev->pdev),sizeof (info->bus_info)); }
@@ -1852,4 +1850,3 @@ module_pci_driver(slic_driver);MODULE_DESCRIPTION ("Alacritech non-accelerated SLIC driver" );MODULE_AUTHOR ("Lino Sanfilippo <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION );
PATCH 9/18 net/allwinner: Remove driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
There is no need in custom driver version for in-tree code.
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/allwinner/sun4i-emac.c +0 -2
@@ -33,7 +33,6 @@#include "sun4i-emac.h" #define DRV_NAME "sun4i-emac" -#define DRV_VERSION "1.02"#define EMAC_MAX_FRAME_LEN 0x0600
@@ -212,7 +211,6 @@ static void emac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) {strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));strlcpy (info->bus_info,dev_name (&dev->dev),sizeof (info->bus_info)); }
Re: [PATCH net-next v1 09/18] net/allwinner: Remove driver version
Quoted 5 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
There is no need in custom driver version for in-tree code.
Signed-off-by Leon Romanovsky <[email protected]>
Thanks!
Maxime
PATCH 10/18 net/alteon: Properly report FW version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
The acenic driver assigns FW version in driver version field, as part of cleanup driver version, set FW version properly.
--- drivers/net/ethernet/alteon/acenic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/alteon/acenic.c +2 -3
@@ -2699,9 +2699,8 @@ static void ace_get_drvinfo(struct net_device *dev,struct ace_private *ap =netdev_priv (dev);strlcpy (info->driver,"acenic" ,sizeof (info->driver)); -snprintf (info->version,sizeof (info->version),"%i.%i.%i" , - ap->firmware_major, ap->firmware_minor, - ap->firmware_fix); +snprintf (info->fw_version,sizeof (info->version),"%i.%i.%i" , + ap->firmware_major, ap->firmware_minor, ap->firmware_fix);if (ap->pdev) strlcpy(info->bus_info, pci_name(ap->pdev),
--
2.24.1
PATCH 11/18 net/althera: Delete hardcoded driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Convert to use default version provided by ethtool.
--- drivers/net/ethernet/altera/altera_tse_ethtool.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/altera/altera_tse_ethtool.c +0 -1
@@ -67,7 +67,6 @@ static void tse_get_drvinfo(struct net_device *dev,u32 rev =ioread32 (&priv->mac_dev->megacore_revision);strcpy (info->driver,"altera_tse" ); -strcpy (info->version,"v8.0" );snprintf (info->fw_version,ETHTOOL_FWVERS_LEN ,"v%d.%d" , rev &0xFFFF , (rev &0xFFFF0000 ) >>16 );sprintf (info->bus_info,"platform" );
PATCH 12/18 net/amazon: Ensure that driver version is aligned to the linux kernel
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Upstream drivers are managed inside global repository and released all together, this ensure that driver version is the same as linux kernel, so update amazon drivers to properly reflect it.
--- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 - drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ++--------------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 11 ----------- 3 files changed, 2 insertions(+), 27 deletions(-)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +0 -1
@@ -404,7 +404,6 @@ static void ena_get_drvinfo(struct net_device *dev,struct ena_adapter *adapter =netdev_priv (dev);strlcpy (info->driver,DRV_MODULE_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_MODULE_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (adapter->pdev),sizeof (info->bus_info)); }
drivers/net/ethernet/amazon/ena/ena_netdev.c +2 -15
@@ -49,12 +49,9 @@#include <linux/bpf_trace.h> #include "ena_pci_id_tbl.h" -static char version[] =DEVICE_NAME " v" DRV_MODULE_VERSION "\n" ; -MODULE_AUTHOR ("Amazon.com, Inc. or its affiliates" );MODULE_DESCRIPTION (DEVICE_NAME );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_MODULE_VERSION );/* Time in jiffies before concluding the transmitter is hung. */ #define TX_TIMEOUT (5 * HZ)
@@ -3093,11 +3090,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev, host_info->os_dist =0 ;strncpy (host_info->os_dist_str,utsname ()->release,sizeof (host_info->os_dist_str) -1 ); - host_info->driver_version = - (DRV_MODULE_VER_MAJOR ) | - (DRV_MODULE_VER_MINOR <<ENA_ADMIN_HOST_INFO_MINOR_SHIFT ) | - (DRV_MODULE_VER_SUBMINOR <<ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT ) | - ("K" [0 ] <<ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT ); + host_info->driver_version =LINUX_VERSION_CODE ; host_info->num_cpus =num_online_cpus (); host_info->driver_supported_features =
@@ -3476,9 +3469,7 @@ static int ena_restore_device(struct ena_adapter *adapter)netif_carrier_on (adapter->netdev);mod_timer (&adapter->timer_service,round_jiffies (jiffies +HZ )); -dev_err (&pdev->dev, -"Device reset completed successfully, Driver info: %s\n" , - version); +dev_err (&pdev->dev,"Device reset completed successfully\n" );return rc; err_disable_msix:
@@ -4116,8 +4107,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)dev_dbg (&pdev->dev,"%s\n" , __func__); -dev_info_once (&pdev->dev,"%s" , version); - rc =pci_enable_device_mem (pdev);if (rc) {dev_err (&pdev->dev,"pci_enable_device_mem() failed!\n" );
@@ -4429,8 +4418,6 @@ static struct pci_driver ena_pci_driver = {static int __init ena_init (void ) { -pr_info ("%s" , version); - ena_wq =create_singlethread_workqueue (DRV_MODULE_NAME );if (!ena_wq) {pr_err ("Failed to create workqueue\n" );
drivers/net/ethernet/amazon/ena/ena_netdev.h +0 -11
@@ -45,18 +45,7 @@#include "ena_com.h" #include "ena_eth_com.h" -#define DRV_MODULE_VER_MAJOR 2 -#define DRV_MODULE_VER_MINOR 1 -#define DRV_MODULE_VER_SUBMINOR 0 -#define DRV_MODULE_NAME "ena" -#ifndef DRV_MODULE_VERSION -#define DRV_MODULE_VERSION \ - __stringify(DRV_MODULE_VER_MAJOR) "." \ - __stringify(DRV_MODULE_VER_MINOR) "." \ - __stringify(DRV_MODULE_VER_SUBMINOR) "K" -#endif -#define DEVICE_NAME "Elastic Network Adapter (ENA)"/* 1 for AENQ + ADMIN */
--
2.24.1
Kiyanovski, Arthur
maintainerRE: [PATCH net-next v1 12/18] net/amazon: Ensure that driver version is aligned to the linux kernel
Quoted 140 lines
-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Monday, February 24, 2020 10:53 AM
To: David S. Miller <[email protected]>; Jakub Kicinski <[email protected]>
Cc: Leon Romanovsky <[email protected]>; Tom Lendacky <[email protected]>; Keyur Chudgar <[email protected]>; Don Fry <[email protected]>; Veaceslav Falico <[email protected]>; Jay Vosburgh <[email protected]>; [email protected]; Maxime Ripard <[email protected]>; Heiko Stuebner <[email protected]>; Mark Einon <[email protected]>; Chris Snook <[email protected]>; [email protected]; Iyappan Subramanian <[email protected]>; Igor Russkikh <[email protected]>; David Dillow <[email protected]>; Belgazal, Netanel <[email protected]>; Quan Nguyen <[email protected]>; Jay Cliburn <[email protected]>; Lino Sanfilippo <[email protected]>; [email protected]; Andreas Larsson <[email protected]>; Andy Gospodarek <[email protected]>; [email protected]; Thor Thayer <[email protected]>; [email protected]; Ion Badulescu <[email protected]>; Kiyanovski, Arthur <[email protected]>; Jes Sorensen <[email protected]>; [email protected]; Chen-Yu Tsai <[email protected]>
Subject: [PATCH net-next v1 12/18] net/amazon: Ensure that driver version is aligned to the linux kernelFrom: Leon Romanovsky <[email protected]>
Upstream drivers are managed inside global repository and released all together, this ensure that driver version is the same as linux kernel, so update amazon drivers to properly reflect it.
Signed-off-by Leon Romanovsky <[email protected]>--- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 - drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ++--------------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 11 ----------- 3 files changed, 2 insertions(+), 27 deletions(-)drivers/net/ethernet/amazon/ena/ena_ethtool.c +0
-1@@ -404,7 +404,6 @@ static void ena_get_drvinfo(struct net_device *dev,struct ena_adapter *adapter =netdev_priv (dev);strlcpy (info->driver,DRV_MODULE_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_MODULE_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (adapter->pdev),sizeof (info->bus_info)); }drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-2@@ -49,12 +49,9 @@#include <linux/bpf_trace.h> #include "ena_pci_id_tbl.h" -static char version[] =DEVICE_NAME " v" DRV_MODULE_VERSION "\n" ; -MODULE_AUTHOR ("Amazon.com, Inc. or its affiliates" );
MODULE_DESCRIPTION(DEVICE_NAME);MODULE_LICENSE("GPL"); -MODULE_VERSION(DRV_MODULE_VERSION);/* Time in jiffies before concluding the transmitter is hung. */ #define
TX_TIMEOUT(5 * HZ) @@ -3093,11 +3090,7 @@ static void ena_config_host_info(structena_com_dev*ena_dev,drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-3host_info->os_dist =0 ;strncpy (host_info->os_dist_str,utsname ()->release,sizeof (host_info->os_dist_str) -1 ); - host_info->driver_version = - (DRV_MODULE_VER_MAJOR) | - (DRV_MODULE_VER_MINOR <<
ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-1- (DRV_MODULE_VER_SUBMINOR <<
ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT) |drivers/net/ethernet/amazon/ena/ena_netdev.c +1
-1- ("K" [0 ] <<ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT ); + host_info->driver_version =LINUX_VERSION_CODE ; host_info->num_cpus =num_online_cpus (); host_info->driver_supported_features = @@ -3476,9 +3469,7 @@static int
ena_restore_device(struct ena_adapter *adapter)drivers/net/ethernet/amazon/ena/ena_netdev.c +1
-5netif_carrier_on (adapter->netdev);mod_timer (&adapter->timer_service,round_jiffies (jiffies +HZ )); -dev_err (&pdev->dev, -"Device reset completed successfully, Driver info: %s\n" , - version); +dev_err (&pdev->dev,"Device reset completed successfully\n" );return rc; err_disable_msix:@@ -4116,8 +4107,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_dbg(&pdev->dev, "%s\n", __func__); -dev_info_once (&pdev->dev,"%s" , version); - rc =pci_enable_device_mem (pdev);if (rc) {drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-2dev_err (&pdev->dev,"pci_enable_device_mem() failed!\n" );@@ -4429,8 +4418,6 @@ static struct pci_driver ena_pci_driver = {static int __init ena_init (void ) { -pr_info ("%s" , version); - ena_wq =create_singlethread_workqueue (DRV_MODULE_NAME );if (!ena_wq) { pr_err("Failed to create workqueue\n"); diff --git
a/drivers/net/ethernet/amazon/ena/ena_netdev.hb/drivers/net/ethernet/amazon/ena/ena_netdev.h
index8795e0b1dc3c..74c7f10b60dd100644drivers/net/ethernet/amazon/ena/ena_netdev.h +0
-12@@ -45,18 +45,7 @@#include "ena_com.h" #include "ena_eth_com.h" -#define DRV_MODULE_VER_MAJOR 2 -#define DRV_MODULE_VER_MINOR 1 -#define DRV_MODULE_VER_SUBMINOR 0 -#define DRV_MODULE_NAME "ena" -#ifndef DRV_MODULE_VERSION -#define DRV_MODULE_VERSION \ - __stringify(DRV_MODULE_VER_MAJOR) "." \ - __stringify(DRV_MODULE_VER_MINOR) "." \ - __stringify(DRV_MODULE_VER_SUBMINOR) "K" -#endif -#define DEVICE_NAME "Elastic Network Adapter (ENA)"/* 1 for AENQ + ADMIN */ --
Quoted 1 line
2.24.1
Hi Leon, David,
This patch is not good for the ENA driver as it breaks the interface with the FW of the ENA device in ena_config_host_info(), host_info is later reported to the FW. Please do not merge it yet.
We are now working on altering your patch so that it won't break this interface and will send it to you in the next few hours.
Thanks,
Arthur
Re: [PATCH net-next v1 12/18] net/amazon: Ensure that driver version is aligned to the linux kernel
Quoted 138 lines · Arthur
Quoted 138 lines
-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Monday, February 24, 2020 10:53 AM
To: David S. Miller <[email protected]>; Jakub Kicinski <[email protected]>
Cc: Leon Romanovsky <[email protected]>; Tom Lendacky <[email protected]>; Keyur Chudgar <[email protected]>; Don Fry <[email protected]>; Veaceslav Falico <[email protected]>; Jay Vosburgh <[email protected]>; [email protected]; Maxime Ripard <[email protected]>; Heiko Stuebner <[email protected]>; Mark Einon <[email protected]>; Chris Snook <[email protected]>; [email protected]; Iyappan Subramanian <[email protected]>; Igor Russkikh <[email protected]>; David Dillow <[email protected]>; Belgazal, Netanel <[email protected]>; Quan Nguyen <[email protected]>; Jay Cliburn <[email protected]>; Lino Sanfilippo <[email protected]>; [email protected]; Andreas Larsson <[email protected]>; Andy Gospodarek <[email protected]>; [email protected]; Thor Thayer <[email protected]>; [email protected]; Ion Badulescu <[email protected]>; Kiyanovski, Arthur <[email protected]>; Jes Sorensen <[email protected]>; [email protected]; Chen-Yu Tsai <[email protected]>
Subject: [PATCH net-next v1 12/18] net/amazon: Ensure that driver version is aligned to the linux kernelFrom: Leon Romanovsky <[email protected]>
Upstream drivers are managed inside global repository and released all together, this ensure that driver version is the same as linux kernel, so update amazon drivers to properly reflect it.
Signed-off-by Leon Romanovsky <[email protected]>--- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 - drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ++--------------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 11 ----------- 3 files changed, 2 insertions(+), 27 deletions(-)drivers/net/ethernet/amazon/ena/ena_ethtool.c +0
-1@@ -404,7 +404,6 @@ static void ena_get_drvinfo(struct net_device *dev,struct ena_adapter *adapter =netdev_priv (dev);strlcpy (info->driver,DRV_MODULE_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_MODULE_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (adapter->pdev),sizeof (info->bus_info)); }drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-2@@ -49,12 +49,9 @@#include <linux/bpf_trace.h> #include "ena_pci_id_tbl.h" -static char version[] =DEVICE_NAME " v" DRV_MODULE_VERSION "\n" ; -MODULE_AUTHOR ("Amazon.com, Inc. or its affiliates" );
MODULE_DESCRIPTION(DEVICE_NAME);MODULE_LICENSE("GPL"); -MODULE_VERSION(DRV_MODULE_VERSION);/* Time in jiffies before concluding the transmitter is hung. */ #define
TX_TIMEOUT(5 * HZ) @@ -3093,11 +3090,7 @@ static void ena_config_host_info(structena_com_dev*ena_dev,drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-3host_info->os_dist =0 ;strncpy (host_info->os_dist_str,utsname ()->release,sizeof (host_info->os_dist_str) -1 ); - host_info->driver_version = - (DRV_MODULE_VER_MAJOR) | - (DRV_MODULE_VER_MINOR <<
ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-1- (DRV_MODULE_VER_SUBMINOR <<
ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT) |drivers/net/ethernet/amazon/ena/ena_netdev.c +1
-1- ("K" [0 ] <<ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT ); + host_info->driver_version =LINUX_VERSION_CODE ; host_info->num_cpus =num_online_cpus (); host_info->driver_supported_features = @@ -3476,9 +3469,7 @@static int
ena_restore_device(struct ena_adapter *adapter)drivers/net/ethernet/amazon/ena/ena_netdev.c +1
-5netif_carrier_on (adapter->netdev);mod_timer (&adapter->timer_service,round_jiffies (jiffies +HZ )); -dev_err (&pdev->dev, -"Device reset completed successfully, Driver info: %s\n" , - version); +dev_err (&pdev->dev,"Device reset completed successfully\n" );return rc; err_disable_msix:@@ -4116,8 +4107,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_dbg(&pdev->dev, "%s\n", __func__); -dev_info_once (&pdev->dev,"%s" , version); - rc =pci_enable_device_mem (pdev);if (rc) {drivers/net/ethernet/amazon/ena/ena_netdev.c +0
-2dev_err (&pdev->dev,"pci_enable_device_mem() failed!\n" );@@ -4429,8 +4418,6 @@ static struct pci_driver ena_pci_driver = {static int __init ena_init (void ) { -pr_info ("%s" , version); - ena_wq =create_singlethread_workqueue (DRV_MODULE_NAME );if (!ena_wq) { pr_err("Failed to create workqueue\n"); diff --git
a/drivers/net/ethernet/amazon/ena/ena_netdev.hb/drivers/net/ethernet/amazon/ena/ena_netdev.h
index8795e0b1dc3c..74c7f10b60dd100644drivers/net/ethernet/amazon/ena/ena_netdev.h +0
-11@@ -45,18 +45,7 @@#include "ena_com.h" #include "ena_eth_com.h" -#define DRV_MODULE_VER_MAJOR 2 -#define DRV_MODULE_VER_MINOR 1 -#define DRV_MODULE_VER_SUBMINOR 0 -#define DRV_MODULE_NAME "ena" -#ifndef DRV_MODULE_VERSION -#define DRV_MODULE_VERSION \ - __stringify(DRV_MODULE_VER_MAJOR) "." \ - __stringify(DRV_MODULE_VER_MINOR) "." \ - __stringify(DRV_MODULE_VER_SUBMINOR) "K" -#endif -#define DEVICE_NAME "Elastic Network Adapter (ENA)"
Quoted 8 lines
Quoted 3 lines
drivers/net/ethernet/amazon/ena/ena_netdev.h +0
-1/* 1 for AENQ + ADMIN */ --2.24.1
Hi Leon, David,
This patch is not good for the ENA driver as it breaks the interface with the FW of the ENA device in
ena_config_host_info(),host_infois later reported to the FW. Please do not merge it yet.
As I wrote here [1], I tried to avoid any changes in SW<->FW interfaces. Can you please show me the dump stack of how is such info forwarded to FW? How do you distinguish between different distro versions and driver releases?
Quoted 1 line
We are now working on altering your patch so that it won't break this interface and will send it to you in the next few hours.
It is good, thanks.
[1] https://lore.kernel.org/netdev/20200223091031.GA422704@unreal
Quoted 4 lines
Thanks,
Arthur
PATCH 1/1 net/amazon: Ensure that driver version is aligned to the linux kernel
From: Arthur Kiyanovski <[email protected]>
Upstream drivers are managed inside global repository and released all together, this ensure that driver version is the same as linux kernel, so update amazon drivers to properly reflect it.
Also rename current driver version constants used in interface with ENA device FW for code clarity.
--- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 - drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ++++------------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 16 ++++++++-------- 3 files changed, 12 insertions(+), 22 deletions(-)
drivers/net/ethernet/amazon/ena/ena_ethtool.c +0 -1
@@ -404,7 +404,6 @@ static void ena_get_drvinfo(struct net_device *dev,struct ena_adapter *adapter =netdev_priv (dev);strlcpy (info->driver,DRV_MODULE_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_MODULE_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (adapter->pdev),sizeof (info->bus_info)); }
drivers/net/ethernet/amazon/ena/ena_netdev.c +4 -13
@@ -49,12 +49,9 @@#include "ena_netdev.h" #include "ena_pci_id_tbl.h" -static char version[] =DEVICE_NAME " v" DRV_MODULE_VERSION "\n" ; -MODULE_AUTHOR ("Amazon.com, Inc. or its affiliates" );MODULE_DESCRIPTION (DEVICE_NAME );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_MODULE_VERSION );/* Time in jiffies before concluding the transmitter is hung. */ #define TX_TIMEOUT (5 * HZ)
@@ -2441,9 +2438,9 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev,strncpy (host_info->os_dist_str,utsname ()->release,sizeof (host_info->os_dist_str) -1 ); host_info->driver_version = - (DRV_MODULE_VER_MAJOR ) | - (DRV_MODULE_VER_MINOR <<ENA_ADMIN_HOST_INFO_MINOR_SHIFT ) | - (DRV_MODULE_VER_SUBMINOR <<ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT ) | + (DRV_MODULE_GEN_MAJOR ) | + (DRV_MODULE_GEN_MINOR <<ENA_ADMIN_HOST_INFO_MINOR_SHIFT ) | + (DRV_MODULE_GEN_SUBMINOR <<ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT ) | ("K" [0 ] <<ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT ); host_info->num_cpus =num_online_cpus ();
@@ -2822,9 +2819,7 @@ static int ena_restore_device(struct ena_adapter *adapter)netif_carrier_on (adapter->netdev);mod_timer (&adapter->timer_service,round_jiffies (jiffies +HZ )); -dev_err (&pdev->dev, -"Device reset completed successfully, Driver info: %s\n" , - version); +dev_err (&pdev->dev,"Device reset completed successfully\n" );return rc; err_disable_msix:
@@ -3459,8 +3454,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)dev_dbg (&pdev->dev,"%s\n" , __func__); -dev_info_once (&pdev->dev,"%s" , version); - rc =pci_enable_device_mem (pdev);if (rc) {dev_err (&pdev->dev,"pci_enable_device_mem() failed!\n" );
@@ -3766,8 +3759,6 @@ static struct pci_driver ena_pci_driver = {static int __init ena_init (void ) { -pr_info ("%s" , version); - ena_wq =create_singlethread_workqueue (DRV_MODULE_NAME );if (!ena_wq) {pr_err ("Failed to create workqueue\n" );
drivers/net/ethernet/amazon/ena/ena_netdev.h +8 -8
@@ -44,16 +44,16 @@#include "ena_com.h" #include "ena_eth_com.h" -#define DRV_MODULE_VER_MAJOR 2 -#define DRV_MODULE_VER_MINOR 1 -#define DRV_MODULE_VER_SUBMINOR 0 +#define DRV_MODULE_GEN_MAJOR 2 +#define DRV_MODULE_GEN_MINOR 1 +#define DRV_MODULE_GEN_SUBMINOR 0#define DRV_MODULE_NAME "ena" -#ifndef DRV_MODULE_VERSION -#define DRV_MODULE_VERSION \ - __stringify(DRV_MODULE_VER_MAJOR) "." \ - __stringify(DRV_MODULE_VER_MINOR) "." \ - __stringify(DRV_MODULE_VER_SUBMINOR) "K" +#ifndef DRV_MODULE_GENERATION +#define DRV_MODULE_GENERATION \ + __stringify(DRV_MODULE_GEN_MAJOR) "." \ + __stringify(DRV_MODULE_GEN_MINOR) "." \ + __stringify(DRV_MODULE_GEN_SUBMINOR) "K"#endif #define DEVICE_NAME "Elastic Network Adapter (ENA)"
Signature · 1 line
2.24.1.AMZN
Re: [PATCH] net/amazon: Ensure that driver version is aligned to the linux kernel
Quoted 93 lines · On Mon, Feb 24, 2020 at 03:40:27PM +0000, [email protected] wrote:
From: Arthur Kiyanovski <[email protected]>
Upstream drivers are managed inside global repository and released all together, this ensure that driver version is the same as linux kernel, so update amazon drivers to properly reflect it.
Also rename current driver version constants used in interface with ENA device FW for code clarity.
Signed-off-by Leon Romanovsky <[email protected]>Signed-off-by Arthur Kiyanovski <[email protected]>--- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 - drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ++++------------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 16 ++++++++-------- 3 files changed, 12 insertions(+), 22 deletions(-)drivers/net/ethernet/amazon/ena/ena_ethtool.c +0
-1@@ -404,7 +404,6 @@ static void ena_get_drvinfo(struct net_device *dev,struct ena_adapter *adapter =netdev_priv (dev);strlcpy (info->driver,DRV_MODULE_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_MODULE_VERSION ,sizeof (info->version));strlcpy (info->bus_info,pci_name (adapter->pdev),sizeof (info->bus_info)); }drivers/net/ethernet/amazon/ena/ena_netdev.c +4
-13@@ -49,12 +49,9 @@#include "ena_netdev.h" #include "ena_pci_id_tbl.h" -static char version[] =DEVICE_NAME " v" DRV_MODULE_VERSION "\n" ; -MODULE_AUTHOR ("Amazon.com, Inc. or its affiliates" );MODULE_DESCRIPTION (DEVICE_NAME );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_MODULE_VERSION );/* Time in jiffies before concluding the transmitter is hung. */ #define TX_TIMEOUT (5 * HZ)@@ -2441,9 +2438,9 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev,strncpy (host_info->os_dist_str,utsname ()->release,sizeof (host_info->os_dist_str) -1 ); host_info->driver_version = - (DRV_MODULE_VER_MAJOR ) | - (DRV_MODULE_VER_MINOR <<ENA_ADMIN_HOST_INFO_MINOR_SHIFT ) | - (DRV_MODULE_VER_SUBMINOR <<ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT ) | + (DRV_MODULE_GEN_MAJOR ) | + (DRV_MODULE_GEN_MINOR <<ENA_ADMIN_HOST_INFO_MINOR_SHIFT ) | + (DRV_MODULE_GEN_SUBMINOR <<ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT ) | ("K" [0 ] <<ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT ); host_info->num_cpus =num_online_cpus ();@@ -2822,9 +2819,7 @@ static int ena_restore_device(struct ena_adapter *adapter)netif_carrier_on (adapter->netdev);mod_timer (&adapter->timer_service,round_jiffies (jiffies +HZ )); -dev_err (&pdev->dev, -"Device reset completed successfully, Driver info: %s\n" , - version); +dev_err (&pdev->dev,"Device reset completed successfully\n" );return rc; err_disable_msix:@@ -3459,8 +3454,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)dev_dbg (&pdev->dev,"%s\n" , __func__); -dev_info_once (&pdev->dev,"%s" , version); - rc =pci_enable_device_mem (pdev);if (rc) {dev_err (&pdev->dev,"pci_enable_device_mem() failed!\n" );@@ -3766,8 +3759,6 @@ static struct pci_driver ena_pci_driver = {static int __init ena_init (void ) { -pr_info ("%s" , version); - ena_wq =create_singlethread_workqueue (DRV_MODULE_NAME );if (!ena_wq) {pr_err ("Failed to create workqueue\n" );drivers/net/ethernet/amazon/ena/ena_netdev.h +0
-0
drivers/net/ethernet/amazon/ena/ena_netdev.h line 49
Quoted 9 lines
drivers/net/ethernet/amazon/ena/ena_netdev.h +3
-3@@ -44,16 +44,16 @@#include "ena_com.h" #include "ena_eth_com.h" -#define DRV_MODULE_VER_MAJOR 2 -#define DRV_MODULE_VER_MINOR 1 -#define DRV_MODULE_VER_SUBMINOR 0 +#define DRV_MODULE_GEN_MAJOR 2 +#define DRV_MODULE_GEN_MINOR 1 +#define DRV_MODULE_GEN_SUBMINOR 0
I'm completely fine with this variant and did very similar thing for broadcom driver where authors forwarded similar data to FW, but please add the following line above those defines:
/* DO NOT CHANGE DRV_MODULE_GEN_* values in in-tree code */
Thanks
Quoted 18 lines
drivers/net/ethernet/amazon/ena/ena_netdev.h +5
-6#define DRV_MODULE_NAME "ena" -#ifndef DRV_MODULE_VERSION -#define DRV_MODULE_VERSION \ - __stringify(DRV_MODULE_VER_MAJOR) "." \ - __stringify(DRV_MODULE_VER_MINOR) "." \ - __stringify(DRV_MODULE_VER_SUBMINOR) "K" +#ifndef DRV_MODULE_GENERATION +#define DRV_MODULE_GENERATION \ + __stringify(DRV_MODULE_GEN_MAJOR) "." \ + __stringify(DRV_MODULE_GEN_MINOR) "." \ + __stringify(DRV_MODULE_GEN_SUBMINOR) "K"#endif #define DEVICE_NAME "Elastic Network Adapter (ENA)" --2.24.1.AMZN
PATCH 13/18 net/amd: Remove useless driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Convert AMD drivers to respect universal linux kernel version.
--- drivers/net/ethernet/amd/amd8111e.c | 5 +---- drivers/net/ethernet/amd/au1000_eth.c | 5 ----- drivers/net/ethernet/amd/nmclan_cs.c | 9 +++------ drivers/net/ethernet/amd/pcnet32.c | 7 ------- drivers/net/ethernet/amd/sunlance.c | 10 ---------- drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe-main.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe.h | 1 - 8 files changed, 4 insertions(+), 35 deletions(-)
drivers/net/ethernet/amd/amd8111e.c +1 -4
@@ -84,9 +84,8 @@ Revision History:#include "amd8111e.h" #define MODULE_NAME "amd8111e" -#define MODULE_VERS "3.0.7"MODULE_AUTHOR ("Advanced Micro Devices, Inc." ); -MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version " MODULE_VERS ); +MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller." );MODULE_LICENSE ("GPL" );module_param_array (speed_duplex, int,NULL ,0 );MODULE_PARM_DESC (speed_duplex,"Set device speed and duplex modes, 0: Auto Negotiate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex" );
@@ -1366,7 +1365,6 @@ static void amd8111e_get_drvinfo(struct net_device *dev,struct amd8111e_priv *lp =netdev_priv (dev);struct pci_dev *pci_dev = lp->pci_dev;strlcpy (info->driver,MODULE_NAME ,sizeof (info->driver)); -strlcpy (info->version,MODULE_VERS ,sizeof (info->version));snprintf (info->fw_version,sizeof (info->fw_version),"%u" , chip_version);strlcpy (info->bus_info,pci_name (pci_dev),sizeof (info->bus_info));
@@ -1875,7 +1873,6 @@ static int amd8111e_probe_one(struct pci_dev *pdev,/* display driver and device information */ chip_version = (readl (lp->mmio +CHIPID ) &0xf0000000 )>>28 ; -dev_info (&pdev->dev,"AMD-8111e Driver Version: %s\n" ,MODULE_VERS );dev_info (&pdev->dev,"[ Rev %x ] PCI 10/100BaseT Ethernet %pM\n" , chip_version, dev->dev_addr);if (lp->ext_phy_id)
drivers/net/ethernet/amd/au1000_eth.c +0 -5
@@ -63,14 +63,12 @@ static int au1000_debug = 3; NETIF_MSG_LINK)#define DRV_NAME "au1000_eth" -#define DRV_VERSION "1.7"#define DRV_AUTHOR "Pete Popov <[email protected]>"#define DRV_DESC "Au1xxx on-chip Ethernet driver"MODULE_AUTHOR (DRV_AUTHOR );MODULE_DESCRIPTION (DRV_DESC );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION );/* AU1000 MAC registers and bits */ #define MAC_CONTROL 0x0
@@ -656,7 +654,6 @@ au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)struct au1000_private *aup =netdev_priv (dev);strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));snprintf (info->bus_info,sizeof (info->bus_info),"%s %d" ,DRV_NAME , aup->mac_id); }
@@ -1290,8 +1287,6 @@ static int au1000_probe(struct platform_device *pdev)netdev_info (dev,"Au1xx0 Ethernet found at 0x%lx, irq %d\n" , (unsigned long )base->start, irq); -pr_info_once ("%s version %s %s\n" ,DRV_NAME ,DRV_VERSION ,DRV_AUTHOR ); -return 0 ; err_out:
drivers/net/ethernet/amd/nmclan_cs.c +3 -6
@@ -114,8 +114,6 @@ Log: nmclan_cs.c,v#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#define DRV_NAME "nmclan_cs" -#define DRV_VERSION "0.16" -/* ---------------------------------------------------------------------------- Conditional Compilation Options
@@ -367,7 +365,7 @@ typedef struct _mace_private {char tx_free_frames;/* Number of free transmit frame buffers */ char tx_irq_disabled;/* MACE TX interrupt disabled */ - +spinlock_t bank_lock;/* Must be held if you step off bank 0 */ } mace_private;
@@ -444,7 +442,7 @@ static int nmclan_probe(struct pcmcia_device *link) lp =netdev_priv (dev); lp->p_dev = link; link->priv = dev; - +spin_lock_init (&lp->bank_lock); link->resource[0 ]->end =32 ; link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ;
@@ -817,7 +815,6 @@ static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) {strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));snprintf (info->bus_info,sizeof (info->bus_info),"PCMCIA 0x%lx" , dev->base_addr); }
@@ -1110,7 +1107,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)if (pkt_len &1 ) *(skb_tail_pointer (skb) -1 ) =inb (ioaddr +AM2150_RCV ); skb->protocol =eth_type_trans (skb, dev); - +netif_rx (skb);/* Send the packet to the upper (protocol) layers. */ dev->stats.rx_packets++;
drivers/net/ethernet/amd/pcnet32.c +0 -7
@@ -24,13 +24,9 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#define DRV_NAME "pcnet32" -#define DRV_VERSION "1.35"#define DRV_RELDATE "21.Apr.2008"#define PFX DRV_NAME ": " -static const char *const version = -DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " [email protected]\n" ; -#include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h>
@@ -809,7 +805,6 @@ static void pcnet32_get_drvinfo(struct net_device *dev,struct pcnet32_private *lp =netdev_priv (dev);strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));if (lp->pci_dev)strlcpy (info->bus_info,pci_name (lp->pci_dev),sizeof (info->bus_info));
@@ -3006,8 +3001,6 @@ MODULE_LICENSE("GPL");static int __init pcnet32_init_module (void ) { -pr_info ("%s" , version); - pcnet32_debug =netif_msg_init (debug,PCNET32_MSG_DEFAULT );if ((tx_start_pt >=0 ) && (tx_start_pt <=3 ))
drivers/net/ethernet/amd/sunlance.c +0 -10
@@ -105,14 +105,9 @@ static char lancestr[] = "LANCE";#include <asm/irq.h> #define DRV_NAME "sunlance" -#define DRV_VERSION "2.02"#define DRV_RELDATE "8/24/03"#define DRV_AUTHOR "Miguel de Icaza ([email protected])" -static char version[] = -DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n" ; - -MODULE_VERSION (DRV_VERSION );MODULE_AUTHOR (DRV_AUTHOR );MODULE_DESCRIPTION ("Sun Lance ethernet driver" );MODULE_LICENSE ("GPL" );
@@ -1282,7 +1277,6 @@ static void lance_free_hwresources(struct lance_private *lp)static void sparc_lance_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) {strlcpy (info->driver,"sunlance" ,sizeof (info->driver)); -strlcpy (info->version,"2.02" ,sizeof (info->version)); }static const struct ethtool_ops sparc_lance_ethtool_ops = {
@@ -1305,7 +1299,6 @@ static int sparc_lance_probe_one(struct platform_device *op, struct platform_device *lebuffer) {struct device_node *dp = op->dev.of_node; -static unsigned version_printed;struct lance_private *lp;struct net_device *dev;int i;
@@ -1316,9 +1309,6 @@ static int sparc_lance_probe_one(struct platform_device *op, lp =netdev_priv (dev); -if (sparc_lance_debug && version_printed++ ==0 ) -printk (KERN_INFO "%s" , version); -spin_lock_init (&lp->lock);/* Copy the IDPROM ethernet address to the device structure, later we
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c +0 -1
@@ -405,7 +405,6 @@ static void xgbe_get_drvinfo(struct net_device *netdev,struct xgbe_hw_features *hw_feat = &pdata->hw_feat;strlcpy (drvinfo->driver,XGBE_DRV_NAME ,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version,XGBE_DRV_VERSION ,sizeof (drvinfo->version));strlcpy (drvinfo->bus_info,dev_name (pdata->dev),sizeof (drvinfo->bus_info)); snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d.%d.%d",
drivers/net/ethernet/amd/xgbe/xgbe-main.c +0 -1
@@ -127,7 +127,6 @@MODULE_AUTHOR ("Tom Lendacky <[email protected]>" );MODULE_LICENSE ("Dual BSD/GPL" ); -MODULE_VERSION (XGBE_DRV_VERSION );MODULE_DESCRIPTION (XGBE_DRV_DESC );static int debug =-1 ;
drivers/net/ethernet/amd/xgbe/xgbe.h +0 -1
@@ -135,7 +135,6 @@#include <linux/list.h> #define XGBE_DRV_NAME "amd-xgbe" -#define XGBE_DRV_VERSION "1.0.3"#define XGBE_DRV_DESC "AMD 10 Gigabit Ethernet Driver"/* Descriptor related defines */
PATCH 14/18 net/apm: Remove useless driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Delete module version in favor of global and unique linux kernel.
--- drivers/net/ethernet/apm/xgene-v2/ethtool.c | 1 - drivers/net/ethernet/apm/xgene-v2/main.c | 1 - drivers/net/ethernet/apm/xgene-v2/main.h | 1 - drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c | 1 - drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 1 - drivers/net/ethernet/apm/xgene/xgene_enet_main.h | 1 - 6 files changed, 6 deletions(-)
drivers/net/ethernet/apm/xgene-v2/ethtool.c +0 -1
@@ -89,7 +89,6 @@ static void xge_get_drvinfo(struct net_device *ndev,struct platform_device *pdev = pdata->pdev;strcpy (info->driver,"xgene-enet-v2" ); -strcpy (info->version,XGENE_ENET_V2_VERSION );snprintf (info->fw_version,ETHTOOL_FWVERS_LEN ,"N/A" );sprintf (info->bus_info,"%s" , pdev->name); }
drivers/net/ethernet/apm/xgene-v2/main.c +0 -1
@@ -741,5 +741,4 @@ module_platform_driver(xge_driver);MODULE_DESCRIPTION ("APM X-Gene SoC Ethernet v2 driver" );MODULE_AUTHOR ("Iyappan Subramanian <[email protected]>" ); -MODULE_VERSION (XGENE_ENET_V2_VERSION );MODULE_LICENSE ("GPL" );
drivers/net/ethernet/apm/xgene-v2/main.h +0 -1
@@ -28,7 +28,6 @@#include "ring.h" #include "ethtool.h" -#define XGENE_ENET_V2_VERSION "v1.0"#define XGENE_ENET_STD_MTU 1536#define XGENE_ENET_MIN_FRAME 60#define IRQ_ID_SIZE 16
drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c +0 -1
@@ -103,7 +103,6 @@ static void xgene_get_drvinfo(struct net_device *ndev,struct platform_device *pdev = pdata->pdev;strcpy (info->driver,"xgene_enet" ); -strcpy (info->version,XGENE_DRV_VERSION );snprintf (info->fw_version,ETHTOOL_FWVERS_LEN ,"N/A" );sprintf (info->bus_info,"%s" , pdev->name); }
drivers/net/ethernet/apm/xgene/xgene_enet_main.c +0 -1
@@ -2179,7 +2179,6 @@ static struct platform_driver xgene_enet_driver = {module_platform_driver (xgene_enet_driver);MODULE_DESCRIPTION ("APM X-Gene SoC Ethernet driver" ); -MODULE_VERSION (XGENE_DRV_VERSION );MODULE_AUTHOR ("Iyappan Subramanian <[email protected]>" );MODULE_AUTHOR ("Keyur Chudgar <[email protected]>" );MODULE_LICENSE ("GPL" );
drivers/net/ethernet/apm/xgene/xgene_enet_main.h +0 -1
@@ -28,7 +28,6 @@#include "xgene_enet_ring2.h" #include "../../../phy/mdio-xgene.h" -#define XGENE_DRV_VERSION "v1.0"#define ETHER_MIN_PACKET 64#define ETHER_STD_PACKET 1518#define XGENE_ENET_STD_MTU 1536
--
2.24.1
PATCH 15/18 net/apm: Properly mark absence of FW
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
There is no need to set "N/A" if FW is not available.
--- drivers/net/ethernet/apm/xgene-v2/ethtool.c | 1 - drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/ethernet/apm/xgene-v2/ethtool.c +0 -1
@@ -89,7 +89,6 @@ static void xge_get_drvinfo(struct net_device *ndev,struct platform_device *pdev = pdata->pdev;strcpy (info->driver,"xgene-enet-v2" ); -snprintf (info->fw_version,ETHTOOL_FWVERS_LEN ,"N/A" );sprintf (info->bus_info,"%s" , pdev->name); }
drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c +0 -1
@@ -103,7 +103,6 @@ static void xgene_get_drvinfo(struct net_device *ndev,struct platform_device *pdev = pdata->pdev;strcpy (info->driver,"xgene_enet" ); -snprintf (info->fw_version,ETHTOOL_FWVERS_LEN ,"N/A" );sprintf (info->bus_info,"%s" , pdev->name); }
--
2.24.1
PATCH 16/18 net/aquantia: Delete module version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
There is no need to keep module and driver versions in in-tree kernel code.
--- drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 4 ---- drivers/net/ethernet/aquantia/atlantic/aq_common.h | 1 - drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c | 1 - drivers/net/ethernet/aquantia/atlantic/aq_main.c | 1 - drivers/net/ethernet/aquantia/atlantic/ver.h | 12 ------------ 5 files changed, 19 deletions(-) delete mode 100644 drivers/net/ethernet/aquantia/atlantic/ver.h
drivers/net/ethernet/aquantia/atlantic/aq_cfg.h +0 -4
@@ -9,8 +9,6 @@#ifndef AQ_CFG_H #define AQ_CFG_H -#include <generated/utsrelease.h> -#define AQ_CFG_VECS_DEF 8U#define AQ_CFG_TCS_DEF 1U
@@ -85,7 +83,5 @@#define AQ_CFG_DRV_AUTHOR "aQuantia"#define AQ_CFG_DRV_DESC "aQuantia Corporation(R) Network Driver"#define AQ_CFG_DRV_NAME "atlantic" -#define AQ_CFG_DRV_VERSION UTS_RELEASE \ - AQ_CFG_DRV_VERSION_SUFFIX#endif /* AQ_CFG_H */
drivers/net/ethernet/aquantia/atlantic/aq_common.h +0 -1
@@ -12,7 +12,6 @@#include <linux/etherdevice.h> #include <linux/pci.h> #include <linux/if_vlan.h> -#include "ver.h" #include "aq_cfg.h" #include "aq_utils.h"
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +0 -1
@@ -132,7 +132,6 @@ static void aq_ethtool_get_drvinfo(struct net_device *ndev, regs_count =aq_nic_get_regs_count (aq_nic);strlcat (drvinfo->driver,AQ_CFG_DRV_NAME ,sizeof (drvinfo->driver)); -strlcat (drvinfo->version,AQ_CFG_DRV_VERSION ,sizeof (drvinfo->version)); snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%u.%u.%u", firmware_version >> 24,
drivers/net/ethernet/aquantia/atlantic/aq_main.c +0 -1
@@ -19,7 +19,6 @@#include <linux/udp.h> MODULE_LICENSE ("GPL v2" ); -MODULE_VERSION (AQ_CFG_DRV_VERSION );MODULE_AUTHOR (AQ_CFG_DRV_AUTHOR );MODULE_DESCRIPTION (AQ_CFG_DRV_DESC );
drivers/net/ethernet/aquantia/atlantic/ver.h deleted +0 -12
@@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* aQuantia Corporation Network Driver -* Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved -*/ - -#ifndef VER_H -#define VER_H - -#define AQ_CFG_DRV_VERSION_SUFFIX "-kern" - -#endif /* VER_H */
PATCH 17/18 net/arc: Delete driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Drop constant driver version in favour of global linux kernel.
--- drivers/net/ethernet/arc/emac.h | 1 - drivers/net/ethernet/arc/emac_arc.c | 2 -- drivers/net/ethernet/arc/emac_main.c | 1 - drivers/net/ethernet/arc/emac_rockchip.c | 2 -- 4 files changed, 6 deletions(-)
drivers/net/ethernet/arc/emac.h +0 -1
@@ -130,7 +130,6 @@ struct arc_emac_mdio_bus_data {*/ struct arc_emac_priv {const char *drv_name; -const char *drv_version;void (*set_mac_speed)(void *priv,unsigned int speed);/* Devices */
drivers/net/ethernet/arc/emac_arc.c +0 -2
@@ -15,7 +15,6 @@#include "emac.h" #define DRV_NAME "emac_arc" -#define DRV_VERSION "1.0"static int emac_arc_probe (struct platform_device *pdev) {
@@ -36,7 +35,6 @@ static int emac_arc_probe(struct platform_device *pdev) priv =netdev_priv (ndev); priv->drv_name =DRV_NAME ; - priv->drv_version =DRV_VERSION ; err =of_get_phy_mode (dev->of_node, &interface);if (err) {
drivers/net/ethernet/arc/emac_main.c +0 -1
@@ -92,7 +92,6 @@ static void arc_emac_get_drvinfo(struct net_device *ndev,struct arc_emac_priv *priv =netdev_priv (ndev);strlcpy (info->driver, priv->drv_name,sizeof (info->driver)); -strlcpy (info->version, priv->drv_version,sizeof (info->version)); }static const struct ethtool_ops arc_emac_ethtool_ops = {
drivers/net/ethernet/arc/emac_rockchip.c +0 -2
@@ -16,7 +16,6 @@#include "emac.h" #define DRV_NAME "rockchip_emac" -#define DRV_VERSION "1.1"struct emac_rockchip_soc_data {unsigned int grf_offset;
@@ -112,7 +111,6 @@ static int emac_rockchip_probe(struct platform_device *pdev) priv =netdev_priv (ndev); priv->emac.drv_name =DRV_NAME ; - priv->emac.drv_version =DRV_VERSION ; priv->emac.set_mac_speed = emac_rockchip_set_mac_speed; err =of_get_phy_mode (dev->of_node, &interface);
PATCH 18/18 net/atheros: Clean atheros code from driver version
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
Use linux kernel version for ethtool and module versions.
--- drivers/net/ethernet/atheros/atl1c/atl1c.h | 1 - drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c | 2 -- drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 5 ----- drivers/net/ethernet/atheros/atl1e/atl1e.h | 1 - drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c | 2 -- drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 4 ---- drivers/net/ethernet/atheros/atlx/atl1.c | 6 ------ drivers/net/ethernet/atheros/atlx/atl2.c | 10 ---------- 8 files changed, 31 deletions(-)
drivers/net/ethernet/atheros/atl1c/atl1c.h +0 -1
@@ -583,7 +583,6 @@ struct atl1c_adapter { readl(((a)->hw_addr + reg) + ((offset) << 2)))extern char atl1c_driver_name[]; -extern char atl1c_driver_version[];void atl1c_reinit_locked (struct atl1c_adapter *adapter);s32 atl1c_reset_hw (struct atl1c_hw *hw);
drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c +0 -2
@@ -221,8 +221,6 @@ static void atl1c_get_drvinfo(struct net_device *netdev,struct atl1c_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver, atl1c_driver_name,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version, atl1c_driver_version, -sizeof (drvinfo->version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info)); }
drivers/net/ethernet/atheros/atl1c/atl1c_main.c +0 -5
@@ -8,9 +8,7 @@#include "atl1c.h" -#define ATL1C_DRV_VERSION "1.0.1.1-NAPI"char atl1c_driver_name[] ="atl1c" ; -char atl1c_driver_version[] =ATL1C_DRV_VERSION ;/* * atl1c_pci_tbl - PCI Device ID Table
@@ -37,7 +35,6 @@ MODULE_AUTHOR("Jie Yang");MODULE_AUTHOR ("Qualcomm Atheros Inc., <[email protected]>" );MODULE_DESCRIPTION ("Qualcomm Atheros 100/1000M Ethernet Network Driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (ATL1C_DRV_VERSION );static int atl1c_stop_mac (struct atl1c_hw *hw);static void atl1c_disable_l0s_l1 (struct atl1c_hw *hw);
@@ -2642,8 +2639,6 @@ static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_register; } -if (netif_msg_probe (adapter)) -dev_info (&pdev->dev,"version %s\n" ,ATL1C_DRV_VERSION ); cards_found++;return 0 ;
drivers/net/ethernet/atheros/atl1e/atl1e.h +0 -1
@@ -482,7 +482,6 @@ struct atl1e_adapter { readl(((a)->hw_addr + reg) + ((offset) << 2)))extern char atl1e_driver_name[]; -extern char atl1e_driver_version[];void atl1e_check_options (struct atl1e_adapter *adapter);int atl1e_up (struct atl1e_adapter *adapter);
drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c +0 -2
@@ -307,8 +307,6 @@ static void atl1e_get_drvinfo(struct net_device *netdev,struct atl1e_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver, atl1e_driver_name,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version, atl1e_driver_version, -sizeof (drvinfo->version));strlcpy (drvinfo->fw_version,"L1e" ,sizeof (drvinfo->fw_version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info));
drivers/net/ethernet/atheros/atl1e/atl1e_main.c +0 -4
@@ -8,10 +8,7 @@#include "atl1e.h" -#define DRV_VERSION "1.0.0.7-NAPI" -char atl1e_driver_name[] ="ATL1E" ; -char atl1e_driver_version[] =DRV_VERSION ;#define PCI_DEVICE_ID_ATTANSIC_L1E 0x1026/* * atl1e_pci_tbl - PCI Device ID Table
@@ -33,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, atl1e_pci_tbl);MODULE_AUTHOR ("Atheros Corporation, <[email protected]>, Jie Yang <[email protected]>" );MODULE_DESCRIPTION ("Atheros 1000M Ethernet Network Driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION );static void atl1e_setup_mac_ctrl (struct atl1e_adapter *adapter);
drivers/net/ethernet/atheros/atlx/atl1.c +0 -6
@@ -65,12 +65,10 @@#include "atl1.h" -#define ATLX_DRIVER_VERSION "2.1.3"MODULE_AUTHOR ("Xiong Huang <[email protected]>, " "Chris Snook <[email protected]>, " "Jay Cliburn <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (ATLX_DRIVER_VERSION );/* Temporary hack for merging atl1 and atl2 */ #include "atlx.c"
@@ -2965,8 +2963,6 @@ static int atl1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* get device revision number */ adapter->hw.dev_rev =ioread16 (adapter->hw.hw_addr + (REG_MASTER_CTRL +2 )); -if (netif_msg_probe (adapter)) -dev_info (&pdev->dev,"version %s\n" ,ATLX_DRIVER_VERSION );/* set default ring resource counts */ adapter->rfd_ring.count = adapter->rrd_ring.count =ATL1_DEFAULT_RFD ;
@@ -3344,8 +3340,6 @@ static void atl1_get_drvinfo(struct net_device *netdev,struct atl1_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver,ATLX_DRIVER_NAME ,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version,ATLX_DRIVER_VERSION , -sizeof (drvinfo->version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info)); }
drivers/net/ethernet/atheros/atlx/atl2.c +0 -10
@@ -36,18 +36,13 @@#include "atl2.h" -#define ATL2_DRV_VERSION "2.2.3" -static const char atl2_driver_name[] ="atl2" ;static const char atl2_driver_string[] ="Atheros(R) L2 Ethernet Driver" ; -static const char atl2_copyright[] ="Copyright (c) 2007 Atheros Corporation." ; -static const char atl2_driver_version[] =ATL2_DRV_VERSION ;static const struct ethtool_ops atl2_ethtool_ops;MODULE_AUTHOR ("Atheros Corporation <[email protected]>, Chris Snook <[email protected]>" );MODULE_DESCRIPTION ("Atheros Fast Ethernet Network Driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (ATL2_DRV_VERSION );/* * atl2_pci_tbl - PCI Device ID Table
@@ -1688,9 +1683,6 @@ static struct pci_driver atl2_driver = {*/ static int __init atl2_init_module (void ) { -printk (KERN_INFO "%s - version %s\n" , atl2_driver_string, - atl2_driver_version); -printk (KERN_INFO "%s\n" , atl2_copyright);return pci_register_driver (&atl2_driver); }module_init (atl2_init_module);
@@ -2011,8 +2003,6 @@ static void atl2_get_drvinfo(struct net_device *netdev,struct atl2_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver, atl2_driver_name,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version, atl2_driver_version, -sizeof (drvinfo->version));strlcpy (drvinfo->fw_version,"L2" ,sizeof (drvinfo->fw_version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info));
Re: [PATCH net-next v1 18/18] net/atheros: Clean atheros code from driver version
Quoted 201 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
Use linux kernel version for ethtool and module versions.
Signed-off-by Leon Romanovsky <[email protected]>--- drivers/net/ethernet/atheros/atl1c/atl1c.h | 1 - drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c | 2 -- drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 5 ----- drivers/net/ethernet/atheros/atl1e/atl1e.h | 1 - drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c | 2 -- drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 4 ---- drivers/net/ethernet/atheros/atlx/atl1.c | 6 ------ drivers/net/ethernet/atheros/atlx/atl2.c | 10 ---------- 8 files changed, 31 deletions(-)drivers/net/ethernet/atheros/atl1c/atl1c.h +0
-1@@ -583,7 +583,6 @@ struct atl1c_adapter { readl(((a)->hw_addr + reg) + ((offset) << 2)))extern char atl1c_driver_name[]; -extern char atl1c_driver_version[];void atl1c_reinit_locked (struct atl1c_adapter *adapter);s32 atl1c_reset_hw (struct atl1c_hw *hw);drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c +0
-2@@ -221,8 +221,6 @@ static void atl1c_get_drvinfo(struct net_device *netdev,struct atl1c_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver, atl1c_driver_name,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version, atl1c_driver_version, -sizeof (drvinfo->version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info)); }drivers/net/ethernet/atheros/atl1c/atl1c_main.c +0
-5@@ -8,9 +8,7 @@#include "atl1c.h" -#define ATL1C_DRV_VERSION "1.0.1.1-NAPI"char atl1c_driver_name[] ="atl1c" ; -char atl1c_driver_version[] =ATL1C_DRV_VERSION ;/* * atl1c_pci_tbl - PCI Device ID Table @@ -37,7 +35,6 @@ MODULE_AUTHOR("Jie Yang");MODULE_AUTHOR ("Qualcomm Atheros Inc., <[email protected]>" );MODULE_DESCRIPTION ("Qualcomm Atheros 100/1000M Ethernet Network Driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (ATL1C_DRV_VERSION );static int atl1c_stop_mac (struct atl1c_hw *hw);static void atl1c_disable_l0s_l1 (struct atl1c_hw *hw);@@ -2642,8 +2639,6 @@ static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_register; } -if (netif_msg_probe (adapter)) -dev_info (&pdev->dev,"version %s\n" ,ATL1C_DRV_VERSION ); cards_found++;return 0 ;drivers/net/ethernet/atheros/atl1e/atl1e.h +0
-1@@ -482,7 +482,6 @@ struct atl1e_adapter { readl(((a)->hw_addr + reg) + ((offset) << 2)))extern char atl1e_driver_name[]; -extern char atl1e_driver_version[];void atl1e_check_options (struct atl1e_adapter *adapter);int atl1e_up (struct atl1e_adapter *adapter);drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c +0
-2@@ -307,8 +307,6 @@ static void atl1e_get_drvinfo(struct net_device *netdev,struct atl1e_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver, atl1e_driver_name,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version, atl1e_driver_version, -sizeof (drvinfo->version));strlcpy (drvinfo->fw_version,"L1e" ,sizeof (drvinfo->fw_version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info));drivers/net/ethernet/atheros/atl1e/atl1e_main.c +0
-4@@ -8,10 +8,7 @@#include "atl1e.h" -#define DRV_VERSION "1.0.0.7-NAPI" -char atl1e_driver_name[] ="ATL1E" ; -char atl1e_driver_version[] =DRV_VERSION ;#define PCI_DEVICE_ID_ATTANSIC_L1E 0x1026/* * atl1e_pci_tbl - PCI Device ID Table @@ -33,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, atl1e_pci_tbl);MODULE_AUTHOR ("Atheros Corporation, <[email protected]>, Jie Yang <[email protected]>" );MODULE_DESCRIPTION ("Atheros 1000M Ethernet Network Driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (DRV_VERSION );static void atl1e_setup_mac_ctrl (struct atl1e_adapter *adapter);drivers/net/ethernet/atheros/atlx/atl1.c +0
-6@@ -65,12 +65,10 @@#include "atl1.h" -#define ATLX_DRIVER_VERSION "2.1.3"MODULE_AUTHOR ("Xiong Huang <[email protected]>, " "Chris Snook <[email protected]>, " "Jay Cliburn <[email protected]>" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (ATLX_DRIVER_VERSION );/* Temporary hack for merging atl1 and atl2 */ #include "atlx.c" @@ -2965,8 +2963,6 @@ static int atl1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* get device revision number */ adapter->hw.dev_rev =ioread16 (adapter->hw.hw_addr + (REG_MASTER_CTRL +2 )); -if (netif_msg_probe (adapter)) -dev_info (&pdev->dev,"version %s\n" ,ATLX_DRIVER_VERSION );/* set default ring resource counts */ adapter->rfd_ring.count = adapter->rrd_ring.count =ATL1_DEFAULT_RFD ;@@ -3344,8 +3340,6 @@ static void atl1_get_drvinfo(struct net_device *netdev,struct atl1_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver,ATLX_DRIVER_NAME ,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version,ATLX_DRIVER_VERSION , -sizeof (drvinfo->version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info)); }drivers/net/ethernet/atheros/atlx/atl2.c +0
-11@@ -36,18 +36,13 @@#include "atl2.h" -#define ATL2_DRV_VERSION "2.2.3" -static const char atl2_driver_name[] ="atl2" ;static const char atl2_driver_string[] ="Atheros(R) L2 Ethernet Driver" ; -static const char atl2_copyright[] ="Copyright (c) 2007 Atheros Corporation." ; -static const char atl2_driver_version[] =ATL2_DRV_VERSION ;static const struct ethtool_ops atl2_ethtool_ops;MODULE_AUTHOR ("Atheros Corporation <[email protected]>, Chris Snook <[email protected]>" );MODULE_DESCRIPTION ("Atheros Fast Ethernet Network Driver" );MODULE_LICENSE ("GPL" ); -MODULE_VERSION (ATL2_DRV_VERSION );/* * atl2_pci_tbl - PCI Device ID Table @@ -1688,9 +1683,6 @@ static struct pci_driver atl2_driver = {*/ static int __init atl2_init_module (void ) { -printk (KERN_INFO "%s - version %s\n" , atl2_driver_string, - atl2_driver_version); -printk (KERN_INFO "%s\n" , atl2_copyright);return pci_register_driver (&atl2_driver); }module_init (atl2_init_module);@@ -2011,8 +2003,6 @@ static void atl2_get_drvinfo(struct net_device *netdev,struct atl2_adapter *adapter =netdev_priv (netdev);strlcpy (drvinfo->driver, atl2_driver_name,sizeof (drvinfo->driver)); -strlcpy (drvinfo->version, atl2_driver_version, -sizeof (drvinfo->version));strlcpy (drvinfo->fw_version,"L2" ,sizeof (drvinfo->fw_version));strlcpy (drvinfo->bus_info,pci_name (adapter->pdev),sizeof (drvinfo->bus_info)); --2.24.1
David Miller
maintainerFrom: Leon Romanovsky <[email protected]>
Date: Mon, 24 Feb 2020 10:52:53 +0200
Quoted 9 lines
From: Leon Romanovsky <[email protected]>
Change log:
v1:
* Split all FW cleanups patches to separate patches
* Fixed commit message
* Deleted oddDRV_RELDATE
* Added everyone fromMAINTAINERSfile
v0: https://lore.kernel.org/netdev/[email protected]
Series applied, thanks Leon.