Skip to contentSkip to conversation

backports: replace igb patches with generic cocci patches

PATCH In review Stefan Assmann 3 participants 17 messages Feb 25, 2015 – Apr 25, 2015

lore
Share & tools
lore
#0 lore raw

cover backports: replace igb patches with generic cocci patches

With these patches we replace several of the igb network driver specific patches with more generalized coccinelle patches. Thus the patches are no longer igb specific but apply to every wired ethernet driver we may choose to backport in the future.

Some of the new cocci patches required some fixes to coccinelle, thus the last patch bumps the required version number.

Hopefully this will ease the work of adding new network drivers to the project. Comments and suggestions welcome.

Stefan

Stefan Assmann (10):
backports: replace struct ethtool_ops get_ts_info changes with smpl
patch
backports: replace struct ethtool_ops get/set_eee changes with smpl
patch
backports: replace struct ethtool_ops get_module changes with smpl
patch
backports: replace struct pci_driver sriov_configure changes with smpl
patch
backports: replace struct pci_error_handlers changes with smpl patch
backports: replace struct ethtool_ops get_rxnfc changes with smpl
patch
backports: replace struct net_device_ops set_vf_spoofchk changes with
smpl patch
backports: replace struct net_device_ops set_vf_rate changes with smpl
patch
backports: remove devm_hwmon_device_register_with_groups references
with smpl patch
backports: require coccinelle version 1.0.0-rc24

 gentree.py                                         |  2 +-
 .../network/0017-get_ts_info/cdc_ncm.patch         | 12 ----
 .../0017-get_ts_info/drivers_net_usb_usbnet.patch  | 12 ----
 .../network/0017-get_ts_info/get_ts_info.cocci     | 19 ++++++
 .../network/0017-get_ts_info/igb_get_ts_info.patch | 28 --------
 .../0032-sriov_configure/igb_sriov_configure.patch | 40 +----------
 .../0032-sriov_configure/sriov_configure.cocci     | 19 ++++++
 .../igb_ndo_set_vf_spoofchk.patch                  | 49 --------------
 .../0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci | 41 ++++++++++++
 .../network/0036-ethtool_eee/ethtool_eee.cocci     | 37 ++++++++++
 .../network/0036-ethtool_eee/igb_ethtool_eee.patch | 29 --------
 .../0037-ethtool_get_module/get_module.cocci       | 37 ++++++++++
 .../0037-ethtool_get_module/igb_get_module.patch   | 29 --------
 .../0038-ethtool_rxfh_indir/igb_rxfh_indir.patch   |  2 +-
 .../network/0039-ethtool_rxnfc/igb_rxnfc.patch     | 16 -----
 .../network/0039-ethtool_rxnfc/rxnfc.cocci         | 22 ++++++
 ...m_hwmon_device_register_with_groups.patch.cocci | 40 +++++++++++
 ...gb-devm_hwmon_device_register_with_groups.patch | 28 --------
 .../network/0042-pci_error_handlers/alx.patch      | 14 ----
 .../network/0042-pci_error_handlers/atl1c.patch    | 14 ----
 .../igb_pci_error_handlers.cocci                   |  9 +++
 .../igb_pci_error_handlers.patch                   | 14 ----
 .../network/0042-pci_error_handlers/ngene.patch    | 14 ----
 .../network/0043-ndo_set_vf_rate/INFO              | 17 +++++
 .../network/0043-ndo_set_vf_rate/igb.patch         | 78 ----------------------
 .../0043-ndo_set_vf_rate/igb_set_vf_rate.patch     | 28 ++++++++
 .../network/0043-ndo_set_vf_rate/set_vf_rate.cocci | 50 ++++++++++++++
 27 files changed, 323 insertions(+), 377 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/cdc_ncm.patch
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/drivers_net_usb_usbnet.patch
 create mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/get_ts_info.cocci
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/igb_get_ts_info.patch
 create mode 100644 patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci
 delete mode 100644 patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch
 create mode 100644 patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci
 create mode 100644 patches/collateral-evolutions/network/0036-ethtool_eee/ethtool_eee.cocci
 delete mode 100644 patches/collateral-evolutions/network/0036-ethtool_eee/igb_ethtool_eee.patch
 create mode 100644 patches/collateral-evolutions/network/0037-ethtool_get_module/get_module.cocci
 delete mode 100644 patches/collateral-evolutions/network/0037-ethtool_get_module/igb_get_module.patch
 delete mode 100644 patches/collateral-evolutions/network/0039-ethtool_rxnfc/igb_rxnfc.patch
 create mode 100644 patches/collateral-evolutions/network/0039-ethtool_rxnfc/rxnfc.cocci
 create mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/devm_hwmon_device_register_with_groups.patch.cocci
 delete mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/alx.patch
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/atl1c.patch
 create mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.cocci
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.patch
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/ngene.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/INFO
 delete mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb_set_vf_rate.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/set_vf_rate.cocci
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/10 backports: replace struct ethtool_ops get_ts_info changes with smpl patch

---
 .../network/0017-get_ts_info/cdc_ncm.patch         | 12 ----------
 .../0017-get_ts_info/drivers_net_usb_usbnet.patch  | 12 ----------
 .../network/0017-get_ts_info/get_ts_info.cocci     | 19 +++++++++++++++
 .../network/0017-get_ts_info/igb_get_ts_info.patch | 28 ----------------------
 4 files changed, 19 insertions(+), 52 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/cdc_ncm.patch
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/drivers_net_usb_usbnet.patch
 create mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/get_ts_info.cocci
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/igb_get_ts_info.patch
patches/collateral-evolutions/network/0017-get_ts_info/cdc_ncm.patch deleted +0 -12
deleted file mode 100644
index 14101f2..0000000
@@ -1,12 +0,0 @@
---- a/drivers/net/usb/cdc_ncm.c
-+++ b/drivers/net/usb/cdc_ncm.c
-@@ -137,7 +137,9 @@ static const struct ethtool_ops cdc_ncm_
- 	.get_drvinfo       = usbnet_get_drvinfo,
- 	.get_msglevel      = usbnet_get_msglevel,
- 	.set_msglevel      = usbnet_set_msglevel,
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
- 	.get_ts_info       = ethtool_op_get_ts_info,
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
- 	.get_sset_count    = cdc_ncm_get_sset_count,
- 	.get_strings       = cdc_ncm_get_strings,
- 	.get_ethtool_stats = cdc_ncm_get_ethtool_stats,
patches/collateral-evolutions/network/0017-get_ts_info/drivers_net_usb_usbnet.patch deleted +0 -12
deleted file mode 100644
index c19f6b1..0000000
@@ -1,12 +0,0 @@
---- a/drivers/net/usb/usbnet.c
-+++ b/drivers/net/usb/usbnet.c
-@@ -1022,7 +1022,9 @@ static const struct ethtool_ops usbnet_e
- 	.get_drvinfo		= usbnet_get_drvinfo,
- 	.get_msglevel		= usbnet_get_msglevel,
- 	.set_msglevel		= usbnet_set_msglevel,
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
- 	.get_ts_info		= ethtool_op_get_ts_info,
-+#endif
- };
- 
- /*-------------------------------------------------------------------------*/
patches/collateral-evolutions/network/0017-get_ts_info/get_ts_info.cocci new file +19 -0
new file mode 100644
index 0000000..3e023a3
@@ -0,0 +1,19 @@
+@r1@
+identifier s, func;
+@@
+
+struct ethtool_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+.get_ts_info = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+};
+
+// ----------------------------------------------------------------------
+
+@@
+identifier r1.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
patches/collateral-evolutions/network/0017-get_ts_info/igb_get_ts_info.patch deleted +0 -28
deleted file mode 100644
index 4aef54c..0000000
@@ -1,28 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
-+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
-@@ -2352,6 +2352,7 @@ static void igb_get_strings(struct net_d
- 	}
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
- static int igb_get_ts_info(struct net_device *dev,
- 			   struct ethtool_ts_info *info)
- {
-@@ -2407,6 +2408,7 @@ static int igb_get_ts_info(struct net_de
- 		return -EOPNOTSUPP;
- 	}
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
- 
- static int igb_get_rss_hash_opts(struct igb_adapter *adapter,
- 				 struct ethtool_rxnfc *cmd)
-@@ -3042,7 +3044,9 @@ static const struct ethtool_ops igb_etht
- 	.get_ethtool_stats	= igb_get_ethtool_stats,
- 	.get_coalesce		= igb_get_coalesce,
- 	.set_coalesce		= igb_set_coalesce,
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
- 	.get_ts_info		= igb_get_ts_info,
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
- 	.get_rxnfc		= igb_get_rxnfc,
- 	.set_rxnfc		= igb_set_rxnfc,
- 	.get_eee		= igb_get_eee,
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/10 backports: replace struct ethtool_ops get/set_eee changes with smpl patch

In reply to Stefan Assmann
---
 .../network/0036-ethtool_eee/ethtool_eee.cocci     | 37 ++++++++++++++++++++++
 .../network/0036-ethtool_eee/igb_ethtool_eee.patch | 29 -----------------
 2 files changed, 37 insertions(+), 29 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0036-ethtool_eee/ethtool_eee.cocci
 delete mode 100644 patches/collateral-evolutions/network/0036-ethtool_eee/igb_ethtool_eee.patch
patches/collateral-evolutions/network/0036-ethtool_eee/ethtool_eee.cocci new file +37 -0
new file mode 100644
index 0000000..7c2d2fe
@@ -0,0 +1,37 @@
+@r1@
+identifier s, func;
+@@
+
+struct ethtool_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+.get_eee = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
+};
+
+@r2@
+identifier s, func;
+@@
+
+struct ethtool_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+.set_eee = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
+};
+
+// ----------------------------------------------------------------------
+
+@@
+identifier r1.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
+
+@@
+identifier r2.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
patches/collateral-evolutions/network/0036-ethtool_eee/igb_ethtool_eee.patch deleted +0 -29
deleted file mode 100644
index 7e132ef..0000000
@@ -1,29 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
-+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
-@@ -2593,6 +2593,7 @@ static int igb_set_rxnfc(struct net_devi
- 	return ret;
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
- static int igb_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
- {
- 	struct igb_adapter *adapter = netdev_priv(netdev);
-@@ -2744,6 +2745,7 @@ static int igb_set_eee(struct net_device
- 
- 	return 0;
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
- 
- static int igb_get_module_info(struct net_device *netdev,
- 			       struct ethtool_modinfo *modinfo)
-@@ -3049,8 +3051,10 @@ static const struct ethtool_ops igb_etht
- #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
- 	.get_rxnfc		= igb_get_rxnfc,
- 	.set_rxnfc		= igb_set_rxnfc,
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
- 	.get_eee		= igb_get_eee,
- 	.set_eee		= igb_set_eee,
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
- 	.get_module_info	= igb_get_module_info,
- 	.get_module_eeprom	= igb_get_module_eeprom,
- 	.get_rxfh_indir_size	= igb_get_rxfh_indir_size,
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/10 backports: replace struct ethtool_ops get_module changes with smpl patch

In reply to Stefan Assmann

Also required a refreshed of patch patches/collateral-evolutions/network/0038-ethtool_rxfh_indir/igb_rxfh_indir.patch

---
 .../0037-ethtool_get_module/get_module.cocci       | 37 ++++++++++++++++++++++
 .../0037-ethtool_get_module/igb_get_module.patch   | 29 -----------------
 .../0038-ethtool_rxfh_indir/igb_rxfh_indir.patch   |  2 +-
 3 files changed, 38 insertions(+), 30 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0037-ethtool_get_module/get_module.cocci
 delete mode 100644 patches/collateral-evolutions/network/0037-ethtool_get_module/igb_get_module.patch
patches/collateral-evolutions/network/0037-ethtool_get_module/get_module.cocci new file +37 -0
new file mode 100644
index 0000000..c04ccc4
@@ -0,0 +1,37 @@
+@r1@
+identifier s, func;
+@@
+
+struct ethtool_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+.get_module_info = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+};
+
+@r2@
+identifier s, func;
+@@
+
+struct ethtool_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+.get_module_eeprom = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+};
+
+// ----------------------------------------------------------------------
+
+@@
+identifier r1.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+
+@@
+identifier r2.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
patches/collateral-evolutions/network/0037-ethtool_get_module/igb_get_module.patch deleted +0 -29
deleted file mode 100644
index 074ccea..0000000
@@ -1,29 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
-+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
-@@ -2747,6 +2747,7 @@ static int igb_set_eee(struct net_device
- }
- #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
- static int igb_get_module_info(struct net_device *netdev,
- 			       struct ethtool_modinfo *modinfo)
- {
-@@ -2827,6 +2828,7 @@ static int igb_get_module_eeprom(struct
- 
- 	return 0;
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
- 
- static int igb_ethtool_begin(struct net_device *netdev)
- {
-@@ -3055,8 +3057,10 @@ static const struct ethtool_ops igb_etht
- 	.get_eee		= igb_get_eee,
- 	.set_eee		= igb_set_eee,
- #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
- 	.get_module_info	= igb_get_module_info,
- 	.get_module_eeprom	= igb_get_module_eeprom,
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
- 	.get_rxfh_indir_size	= igb_get_rxfh_indir_size,
- 	.get_rxfh		= igb_get_rxfh,
- 	.set_rxfh		= igb_set_rxfh,
patches/collateral-evolutions/network/0038-ethtool_rxfh_indir/igb_rxfh_indir.patch +1 -1
index 1ccec4e..7661edf 100644
@@ -75,9 +75,9 @@
  static unsigned int igb_max_channels(struct igb_adapter *adapter)
  {
 @@ -3061,9 +3082,15 @@ static const struct ethtool_ops igb_etht
+ 	.set_eee		= igb_set_eee,
  	.get_module_info	= igb_get_module_info,
  	.get_module_eeprom	= igb_get_module_eeprom,
- #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
  	.get_rxfh_indir_size	= igb_get_rxfh_indir_size,
  	.get_rxfh		= igb_get_rxfh,
Signature · 1 line
2.1.0
#4 lore raw

PATCH 4/10 backports: replace struct pci_driver sriov_configure changes with smpl patch

In reply to Stefan Assmann

There's still some manual patching done because igb_pci_disable_sriov() will not be used on kernel older than 3.8, which would generate a compile warning.

---
 .../0032-sriov_configure/igb_sriov_configure.patch | 40 ++--------------------
 .../0032-sriov_configure/sriov_configure.cocci     | 19 ++++++++++
 2 files changed, 21 insertions(+), 38 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci
patches/collateral-evolutions/network/0032-sriov_configure/igb_sriov_configure.patch +2 -38
index cd2b268..c6bcbd2 100644
@@ -1,26 +1,6 @@
 --- a/drivers/net/ethernet/intel/igb/igb_main.c
 +++ b/drivers/net/ethernet/intel/igb/igb_main.c
-@@ -196,7 +196,9 @@ static const struct dev_pm_ops igb_pm_op
- };
- #endif
- static void igb_shutdown(struct pci_dev *);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- static int igb_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
- #ifdef CONFIG_IGB_DCA
- static int igb_notify_dca(struct notifier_block *, unsigned long, void *);
- static struct notifier_block dca_notifier = {
-@@ -237,7 +239,9 @@ static struct pci_driver igb_driver = {
- 	.driver.pm = &igb_pm_ops,
- #endif
- 	.shutdown = igb_shutdown,
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- 	.sriov_configure = igb_pci_sriov_configure,
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
- 	.err_handler = &igb_err_handler
- };
- 
-@@ -7567,6 +7571,7 @@ static int igb_sriov_reinit(struct pci_d
+@@ -7572,6 +7572,7 @@ static int igb_sriov_reinit(struct pci_dev *dev)
  	return 0;
  }
  
@@ -28,7 +8,7 @@
  static int igb_pci_disable_sriov(struct pci_dev *dev)
  {
  	int err = igb_disable_sriov(dev);
-@@ -7576,6 +7581,7 @@ static int igb_pci_disable_sriov(struct
+@@ -7581,6 +7582,7 @@ static int igb_pci_disable_sriov(struct pci_dev *dev)
  
  	return err;
  }
@@ -36,19 +16,3 @@
  
  static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs)
  {
-@@ -7593,6 +7599,7 @@ out:
- }
- 
- #endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
- static int igb_pci_sriov_configure(struct pci_dev *dev, int num_vfs)
- {
- #ifdef CONFIG_PCI_IOV
-@@ -7603,6 +7610,7 @@ static int igb_pci_sriov_configure(struc
- #endif
- 	return 0;
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
- 
- #ifdef CONFIG_NET_POLL_CONTROLLER
- /* Polling 'interrupt' - used by things like netconsole to send skbs
patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci new file +19 -0
new file mode 100644
index 0000000..52920b8
@@ -0,0 +1,19 @@
+@r1@
+identifier s, func;
+@@
+
+struct pci_driver s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+.sriov_configure = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
+};
+
+// ----------------------------------------------------------------------
+
+@@
+identifier r1.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
Signature · 1 line
2.1.0
#5 lore raw

PATCH 5/10 backports: replace struct pci_error_handlers changes with smpl patch

In reply to Stefan Assmann
---
 .../network/0042-pci_error_handlers/alx.patch              | 14 --------------
 .../network/0042-pci_error_handlers/atl1c.patch            | 14 --------------
 .../0042-pci_error_handlers/igb_pci_error_handlers.cocci   |  9 +++++++++
 .../0042-pci_error_handlers/igb_pci_error_handlers.patch   | 14 --------------
 .../network/0042-pci_error_handlers/ngene.patch            | 14 --------------
 5 files changed, 9 insertions(+), 56 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/alx.patch
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/atl1c.patch
 create mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.cocci
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.patch
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/ngene.patch
patches/collateral-evolutions/network/0042-pci_error_handlers/alx.patch deleted +0 -14
deleted file mode 100644
index 97b7d4a..0000000
@@ -1,14 +0,0 @@
---- a/drivers/net/ethernet/atheros/alx/main.c
-+++ b/drivers/net/ethernet/atheros/alx/main.c
-@@ -1523,7 +1523,11 @@ static void alx_pci_error_resume(struct
- 	rtnl_unlock();
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
- static const struct pci_error_handlers alx_err_handlers = {
-+#else
-+static struct pci_error_handlers alx_err_handlers = {
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
- 	.error_detected = alx_pci_error_detected,
- 	.slot_reset     = alx_pci_error_slot_reset,
- 	.resume         = alx_pci_error_resume,
patches/collateral-evolutions/network/0042-pci_error_handlers/atl1c.patch deleted +0 -14
deleted file mode 100644
index 239d1b9..0000000
@@ -1,14 +0,0 @@
---- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
-+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
-@@ -2782,7 +2782,11 @@ static void atl1c_io_resume(struct pci_d
- 	netif_device_attach(netdev);
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
- static const struct pci_error_handlers atl1c_err_handler = {
-+#else
-+static struct pci_error_handlers atl1c_err_handler = {
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
- 	.error_detected = atl1c_io_error_detected,
- 	.slot_reset = atl1c_io_slot_reset,
- 	.resume = atl1c_io_resume,
patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.cocci new file +9 -0
new file mode 100644
index 0000000..19147e9
@@ -0,0 +1,9 @@
+@@
+identifier s;
+@@
+
+static
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+const
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+struct pci_error_handlers s = { ... };
patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.patch deleted +0 -14
deleted file mode 100644
index 9064edb..0000000
@@ -1,14 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_main.c
-+++ b/drivers/net/ethernet/intel/igb/igb_main.c
-@@ -232,7 +232,11 @@ static pci_ers_result_t igb_io_error_det
- static pci_ers_result_t igb_io_slot_reset(struct pci_dev *);
- static void igb_io_resume(struct pci_dev *);
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
- static const struct pci_error_handlers igb_err_handler = {
-+#else
-+static struct pci_error_handlers igb_err_handler = {
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
- 	.error_detected = igb_io_error_detected,
- 	.slot_reset = igb_io_slot_reset,
- 	.resume = igb_io_resume,
patches/collateral-evolutions/network/0042-pci_error_handlers/ngene.patch deleted +0 -14
deleted file mode 100644
index 620dbbe..0000000
@@ -1,14 +0,0 @@
---- a/drivers/media/pci/ngene/ngene-cards.c
-+++ b/drivers/media/pci/ngene/ngene-cards.c
-@@ -798,7 +798,11 @@ static void ngene_resume(struct pci_dev
- 	printk(KERN_INFO DEVICE_NAME ": resume\n");
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
- static const struct pci_error_handlers ngene_errors = {
-+#else
-+static struct pci_error_handlers ngene_errors = {
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
- 	.error_detected = ngene_error_detected,
- 	.link_reset = ngene_link_reset,
- 	.slot_reset = ngene_slot_reset,
Signature · 1 line
2.1.0
#6 lore raw

PATCH 6/10 backports: replace struct ethtool_ops get_rxnfc changes with smpl patch

In reply to Stefan Assmann
---
 .../network/0039-ethtool_rxnfc/igb_rxnfc.patch     | 16 ----------------
 .../network/0039-ethtool_rxnfc/rxnfc.cocci         | 22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 16 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/0039-ethtool_rxnfc/igb_rxnfc.patch
 create mode 100644 patches/collateral-evolutions/network/0039-ethtool_rxnfc/rxnfc.cocci
patches/collateral-evolutions/network/0039-ethtool_rxnfc/igb_rxnfc.patch deleted +0 -16
deleted file mode 100644
index 86425c6..0000000
@@ -1,16 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
-+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
-@@ -2452,8 +2452,13 @@ static int igb_get_rss_hash_opts(struct
- 	return 0;
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
- static int igb_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
- 			 u32 *rule_locs)
-+#else
-+static int igb_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
-+			 void *rule_locs)
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
- {
- 	struct igb_adapter *adapter = netdev_priv(dev);
- 	int ret = -EOPNOTSUPP;
patches/collateral-evolutions/network/0039-ethtool_rxnfc/rxnfc.cocci new file +22 -0
new file mode 100644
index 0000000..e546f4d
@@ -0,0 +1,22 @@
+@r@
+identifier s,func;
+@@
+
+struct ethtool_ops s = {
+.get_rxnfc = func,
+};
+
+@@
+identifier r.func,rule_locs;
+typedef u32;
+@@
+
+// ----------------------------------------------------------------------
+
+func(...
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+,u32 *rule_locs
++#else
++,void *rule_locs
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
+ ) { ... }
Signature · 1 line
2.1.0
#7 lore raw

PATCH 7/10 backports: replace struct net_device_ops set_vf_spoofchk changes with smpl patch

In reply to Stefan Assmann
---
 .../igb_ndo_set_vf_spoofchk.patch                  | 49 ----------------------
 .../0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci | 41 ++++++++++++++++++
 2 files changed, 41 insertions(+), 49 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch
 create mode 100644 patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci
patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch deleted +0 -49
deleted file mode 100644
index 879312d..0000000
@@ -1,49 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_main.c
-+++ b/drivers/net/ethernet/intel/igb/igb_main.c
-@@ -178,8 +178,10 @@ static int igb_ndo_set_vf_mac(struct net
- static int igb_ndo_set_vf_vlan(struct net_device *netdev,
- 			       int vf, u16 vlan, u8 qos);
- static int igb_ndo_set_vf_bw(struct net_device *, int, int, int);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
- static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,
- 				   bool setting);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
- static int igb_ndo_get_vf_config(struct net_device *netdev, int vf,
- 				 struct ifla_vf_info *ivi);
- static void igb_check_vf_rate_limit(struct igb_adapter *);
-@@ -2100,7 +2102,9 @@ static const struct net_device_ops igb_n
- 	.ndo_set_vf_mac		= igb_ndo_set_vf_mac,
- 	.ndo_set_vf_vlan	= igb_ndo_set_vf_vlan,
- 	.ndo_set_vf_rate	= igb_ndo_set_vf_bw,
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
- 	.ndo_set_vf_spoofchk	= igb_ndo_set_vf_spoofchk,
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
- 	.ndo_get_vf_config	= igb_ndo_get_vf_config,
- #ifdef CONFIG_NET_POLL_CONTROLLER
- 	.ndo_poll_controller	= igb_netpoll,
-@@ -7918,6 +7922,7 @@ static int igb_ndo_set_vf_bw(struct net_
- 	return 0;
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
- static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,
- 				   bool setting)
- {
-@@ -7944,6 +7949,7 @@ static int igb_ndo_set_vf_spoofchk(struc
- 	adapter->vf_data[vf].spoofchk_enabled = setting;
- 	return 0;
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
- 
- static int igb_ndo_get_vf_config(struct net_device *netdev,
- 				 int vf, struct ifla_vf_info *ivi)
-@@ -7957,7 +7963,9 @@ static int igb_ndo_get_vf_config(struct
- 	ivi->min_tx_rate = 0;
- 	ivi->vlan = adapter->vf_data[vf].pf_vlan;
- 	ivi->qos = adapter->vf_data[vf].pf_qos;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
- 	ivi->spoofchk = adapter->vf_data[vf].spoofchk_enabled;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
- 	return 0;
- }
- 
patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.1.0
#8 lore raw

PATCH 8/10 backports: replace struct net_device_ops set_vf_rate changes with smpl patch

In reply to Stefan Assmann
---
 .../network/0043-ndo_set_vf_rate/INFO              | 17 +++++
 .../network/0043-ndo_set_vf_rate/igb.patch         | 78 ----------------------
 .../0043-ndo_set_vf_rate/igb_set_vf_rate.patch     | 28 ++++++++
 .../network/0043-ndo_set_vf_rate/set_vf_rate.cocci | 50 ++++++++++++++
 4 files changed, 95 insertions(+), 78 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/INFO
 delete mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb_set_vf_rate.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/set_vf_rate.cocci
patches/collateral-evolutions/network/0043-ndo_set_vf_rate/INFO new file +17 -0
new file mode 100644
index 0000000..a8f0c49
@@ -0,0 +1,17 @@
+In kernel 3.16 struct net_device_ops changed and renamed pointer
+ndo_set_vf_tx_rate to ndo_set_vf_rate.
+
+commit ed616689a3d95eb6c9bdbb1ef74b0f50cbdf276a
+Author: Sucheta Chakraborty <[email protected]>
+Date:   Thu May 22 09:59:05 2014 -0400
+
+    net-next:v4: Add support to configure SR-IOV VF minimum and maximum Tx rate through ip tool.
+
+commit 5f8444a3fa617076f8da51a3e8ecce01a5d7f738
+Author: Greg Rose <[email protected]>
+Date:   Sat Oct 8 03:05:24 2011 +0000
+
+    if_link: Add additional parameter to IFLA_VF_INFO for spoof checking
+
+git describe --contains ed616689a3d95eb6c9bdbb1ef74b0f50cbdf276a
+v3.16-rc1~27^2~151
patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb.patch deleted +0 -78

78 lines not on this page · raw message

patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb_set_vf_rate.patch new file +28 -0
new file mode 100644
index 0000000..4c59522
@@ -0,0 +1,28 @@
+--- a/drivers/net/ethernet/intel/igb/igb_main.c
++++ b/drivers/net/ethernet/intel/igb/igb_main.c
+@@ -7863,6 +7875,7 @@ static int igb_ndo_set_vf_bw(struct net_
+ 	if (hw->mac.type != e1000_82576)
+ 		return -EOPNOTSUPP;
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
+ 	if (min_tx_rate)
+ 		return -EINVAL;
+ 
+@@ -7876,7 +7889,17 @@ static int igb_ndo_set_vf_bw(struct net_
+ 	adapter->vf_rate_link_speed = actual_link_speed;
+ 	adapter->vf_data[vf].tx_rate = (u16)max_tx_rate;
+ 	igb_set_vf_rate_limit(hw, vf, max_tx_rate, actual_link_speed);
++#else
++	actual_link_speed = igb_link_mbps(adapter->link_speed);
++	if ((vf >= adapter->vfs_allocated_count) ||
++	    (!(rd32(E1000_STATUS) & E1000_STATUS_LU)) ||
++	    (tx_rate < 0) || (tx_rate > actual_link_speed))
++		return -EINVAL;
+ 
++	adapter->vf_rate_link_speed = actual_link_speed;
++	adapter->vf_data[vf].tx_rate = (u16)tx_rate;
++	igb_set_vf_rate_limit(hw, vf, tx_rate, actual_link_speed);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) */
+ 	return 0;
+ }
+ 
patches/collateral-evolutions/network/0043-ndo_set_vf_rate/set_vf_rate.cocci new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
2.1.0
#9 lore raw

PATCH 9/10 backports: remove devm_hwmon_device_register_with_groups references with smpl patch

In reply to Stefan Assmann
---
 ...m_hwmon_device_register_with_groups.patch.cocci | 40 ++++++++++++++++++++++
 ...gb-devm_hwmon_device_register_with_groups.patch | 28 ---------------
 2 files changed, 40 insertions(+), 28 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/devm_hwmon_device_register_with_groups.patch.cocci
 delete mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch
patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/devm_hwmon_device_register_with_groups.patch.cocci new file +40 -0
new file mode 100644
index 0000000..15c4064
@@ -0,0 +1,40 @@
+// This requires the IS_ERR test to come right after the call
+
+@r@
+identifier hwmon_dev;
+statement S;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
+hwmon_dev = devm_hwmon_device_register_with_groups(...);
+if (IS_ERR(hwmon_dev)) S
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) */
+
+@checkid@
+identifier r.hwmon_dev;
+position p1,p2,p3;
+@@
+
+hwmon_dev@p1 = devm_hwmon_device_register_with_groups(...);
+if (IS_ERR(hwmon_dev@p2)) { <... hwmon_dev@p3 ...> }
+
+// ----------------------------------------------------------------------
+
+@@
+identifier r.hwmon_dev;
+position checkid.p1,checkid.p2,checkid.p3;
+type T;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
+  T hwmon_dev;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) */
+  <... when != hwmon_dev
+(
+   hwmon_dev@p1
+|
+   hwmon_dev@p2
+|
+   hwmon_dev@p3
+)
+  ...>
patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch deleted +0 -28
deleted file mode 100644
index cd83953..0000000
@@ -1,28 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_hwmon.c
-+++ b/drivers/net/ethernet/intel/igb/igb_hwmon.c
-@@ -173,7 +173,9 @@ int igb_sysfs_init(struct igb_adapter *a
- {
- 	struct hwmon_buff *igb_hwmon;
- 	struct i2c_client *client;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
- 	struct device *hwmon_dev;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) */
- 	unsigned int i;
- 	int rc = 0;
- 
-@@ -230,6 +232,7 @@ int igb_sysfs_init(struct igb_adapter *a
- 	igb_hwmon->groups[0] = &igb_hwmon->group;
- 	igb_hwmon->group.attrs = igb_hwmon->attrs;
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
- 	hwmon_dev = devm_hwmon_device_register_with_groups(&adapter->pdev->dev,
- 							   client->name,
- 							   igb_hwmon,
-@@ -242,6 +245,7 @@ int igb_sysfs_init(struct igb_adapter *a
- 	goto exit;
- 
- err:
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) */
- 	igb_sysfs_del_adapter(adapter);
- exit:
- 	return rc;
Signature · 1 line
2.1.0
#10 lore raw

Re: [PATCH 09/10] backports: remove devm_hwmon_device_register_with_groups references with smpl patch

Quoted 8 lines · Stefan Assmann
---
 ...m_hwmon_device_register_with_groups.patch.cocci | 40 ++++++++++++++++++++++
 ...gb-devm_hwmon_device_register_with_groups.patch | 28 ---------------
 2 files changed, 40 insertions(+), 28 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/devm_hwmon_device_register_with_groups.patch.cocci
 delete mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch

I think this patch and this spatch is not needed.

devm_hwmon_device_register_with_groups() gets backported in
https://git.kernel.org/cgit/linux/kernel/git/backports/backports.git/commit/?id=69dbc7cf6d34b903c1dc80f1d4f880fc9acfe6fb

I haven't tested igb without this patch.

Hauke

#11 lore raw

Re: [PATCH 09/10] backports: remove devm_hwmon_device_register_with_groups references with smpl patch

Quoted 10 lines · Hauke Mehrtens
Quoted 8 lines · Stefan Assmann
---
 ...m_hwmon_device_register_with_groups.patch.cocci | 40 ++++++++++++++++++++++
 ...gb-devm_hwmon_device_register_with_groups.patch | 28 ---------------
 2 files changed, 40 insertions(+), 28 deletions(-)
 create mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/devm_hwmon_device_register_with_groups.patch.cocci
 delete mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch
Quoted 6 lines

I think this patch and this spatch is not needed.

devm_hwmon_device_register_with_groups() gets backported in
https://git.kernel.org/cgit/linux/kernel/git/backports/backports.git/commit/?id=69dbc7cf6d34b903c1dc80f1d4f880fc9acfe6fb

I haven't tested igb without this patch.

You're right, I didn't notice this being backported. Please drop this patch and let's remove the old patch as well.

Stefan

Quoted 1 line

From fba5eaf9c6bf19d3c4ee98a217efc21e6cddbe91 Mon Sep 17 00:00:00 2001

From: Stefan Assmann <[email protected]>
Date: Wed, 22 Apr 2015 16:50:50 +0200
Subject: [PATCH] backports: remove
igb-devm_hwmon_device_register_with_groups.patch

This patch is no longer needed due to commit

commit 69dbc7cf6d34b903c1dc80f1d4f880fc9acfe6fb

Author: Mathieu Olivari <[email protected]>
Date:   Sun Jan 25 09:46:02 2015 -0800

backport: add hwmon group registration functions

which provides the missing functionality now

---
 .../INFO                                           | 13 ----------
 ...gb-devm_hwmon_device_register_with_groups.patch | 28 ----------------------
 2 files changed, 41 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/INFO
 delete mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch
patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/INFO deleted +0 -13
deleted file mode 100644
index 9169f68..0000000
@@ -1,13 +0,0 @@
-The new hwmon_device_register_with_groups API has not been backported yet.
-Address this by putting ifdef around the code using the API.
-
-
-commit 74188cba088192e14cd7fd5433876e8c947bcdd8
-Author: Guenter Roeck <[email protected]>
-Date:   Thu Jul 11 20:00:12 2013 -0700
-
-    hwmon: Provide managed hwmon registration
-
-git describe --contains 74188cba088192e14cd7fd5433876e8c947bcdd8
-v3.13-rc1~126^2~30
-
(quoted diff) +0 -0

b/patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch deleted file mode 100644
index cd83953..0000000

patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch deleted +0 -28
@@ -1,28 +0,0 @@
---- a/drivers/net/ethernet/intel/igb/igb_hwmon.c
-+++ b/drivers/net/ethernet/intel/igb/igb_hwmon.c
-@@ -173,7 +173,9 @@ int igb_sysfs_init(struct igb_adapter *a
- {
- 	struct hwmon_buff *igb_hwmon;
- 	struct i2c_client *client;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
- 	struct device *hwmon_dev;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) */
- 	unsigned int i;
- 	int rc = 0;
-
-@@ -230,6 +232,7 @@ int igb_sysfs_init(struct igb_adapter *a
- 	igb_hwmon->groups[0] = &igb_hwmon->group;
- 	igb_hwmon->group.attrs = igb_hwmon->attrs;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
- 	hwmon_dev = devm_hwmon_device_register_with_groups(&adapter->pdev->dev,
- 							   client->name,
- 							   igb_hwmon,
-@@ -242,6 +245,7 @@ int igb_sysfs_init(struct igb_adapter *a
- 	goto exit;
-
- err:
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) */
- 	igb_sysfs_del_adapter(adapter);
- exit:
- 	return rc;
Signature · 1 line
2.1.0
#12 lore raw

PATCH 10/10 backports: require coccinelle version 1.0.0-rc24

In reply to Stefan Assmann

The new more generic ethernet patches require spatch 1.0.0-rc24.

---
 gentree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gentree.py +1 -1
index 8df3906..edff138 100755
@@ -625,7 +625,7 @@ def _main():
     # Our binary requirements go here
     req = reqs.Req()
     req.require('git')
-    req.coccinelle('1.0.0-rc21')
+    req.coccinelle('1.0.0-rc24')
     if not req.reqs_match():
         sys.exit(1)
 
Signature · 1 line
2.1.0
#13 lore raw

Re: [PATCH 10/10] backports: require coccinelle version 1.0.0-rc24

Quoted 13 lines · Stefan Assmann

The new more generic ethernet patches require spatch 1.0.0-rc24.

---
 gentree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gentree.py +0 -0
index 8df3906..edff138 100755

gentree.py def _main(): · line 631

Quoted 8 lines
gentree.py +1 -1
@@ -625,7 +625,7 @@ def _main():
     # Our binary requirements go here
     req = reqs.Req()
     req.require('git')
-    req.coccinelle('1.0.0-rc21')
+    req.coccinelle('1.0.0-rc24')
     if not req.reqs_match():
         sys.exit(1)
 

Hi Stefan,

do you need coccinelle 1.0.0-rc24 or would rc23 also work? Johannes added a patch raising minimum coccinelle to rc23.

Hauke

#14 lore raw

Re: [PATCH 10/10] backports: require coccinelle version 1.0.0-rc24

Quoted 5 lines · Hauke Mehrtens
Quoted 1 line · Stefan Assmann

The new more generic ethernet patches require spatch 1.0.0-rc24.

do you need coccinelle 1.0.0-rc24 or would rc23 also work? Johannes added a patch raising minimum coccinelle to rc23.

I believe his changes do require rc24.

johannes

#15 lore raw

Re: [PATCH 10/10] backports: require coccinelle version 1.0.0-rc24

Quoted 11 lines · Johannes Berg
Quoted 5 lines · Hauke Mehrtens
Quoted 1 line · Stefan Assmann

The new more generic ethernet patches require spatch 1.0.0-rc24.

do you need coccinelle 1.0.0-rc24 or would rc23 also work? Johannes added a patch raising minimum coccinelle to rc23.

I believe his changes do require rc24.

johannes

Correct, the ifdef handling requires rc24.

Stefan

#16 lore raw
In reply to Stefan Assmann
Quoted 78 lines · Stefan Assmann

With these patches we replace several of the igb network driver specific patches with more generalized coccinelle patches. Thus the patches are no longer igb specific but apply to every wired ethernet driver we may choose to backport in the future.

Some of the new cocci patches required some fixes to coccinelle, thus the last patch bumps the required version number.

Hopefully this will ease the work of adding new network drivers to the project. Comments and suggestions welcome.

Stefan

Stefan Assmann (10):
backports: replace struct ethtool_ops get_ts_info changes with smpl
patch
backports: replace struct ethtool_ops get/set_eee changes with smpl
patch
backports: replace struct ethtool_ops get_module changes with smpl
patch
backports: replace struct pci_driver sriov_configure changes with smpl
patch
backports: replace struct pci_error_handlers changes with smpl patch
backports: replace struct ethtool_ops get_rxnfc changes with smpl
patch
backports: replace struct net_device_ops set_vf_spoofchk changes with
smpl patch
backports: replace struct net_device_ops set_vf_rate changes with smpl
patch
backports: remove devm_hwmon_device_register_with_groups references
with smpl patch
backports: require coccinelle version 1.0.0-rc24

 gentree.py                                         |  2 +-
 .../network/0017-get_ts_info/cdc_ncm.patch         | 12 ----
 .../0017-get_ts_info/drivers_net_usb_usbnet.patch  | 12 ----
 .../network/0017-get_ts_info/get_ts_info.cocci     | 19 ++++++
 .../network/0017-get_ts_info/igb_get_ts_info.patch | 28 --------
 .../0032-sriov_configure/igb_sriov_configure.patch | 40 +----------
 .../0032-sriov_configure/sriov_configure.cocci     | 19 ++++++
 .../igb_ndo_set_vf_spoofchk.patch                  | 49 --------------
 .../0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci | 41 ++++++++++++
 .../network/0036-ethtool_eee/ethtool_eee.cocci     | 37 ++++++++++
 .../network/0036-ethtool_eee/igb_ethtool_eee.patch | 29 --------
 .../0037-ethtool_get_module/get_module.cocci       | 37 ++++++++++
 .../0037-ethtool_get_module/igb_get_module.patch   | 29 --------
 .../0038-ethtool_rxfh_indir/igb_rxfh_indir.patch   |  2 +-
 .../network/0039-ethtool_rxnfc/igb_rxnfc.patch     | 16 -----
 .../network/0039-ethtool_rxnfc/rxnfc.cocci         | 22 ++++++
 ...m_hwmon_device_register_with_groups.patch.cocci | 40 +++++++++++
 ...gb-devm_hwmon_device_register_with_groups.patch | 28 --------
 .../network/0042-pci_error_handlers/alx.patch      | 14 ----
 .../network/0042-pci_error_handlers/atl1c.patch    | 14 ----
 .../igb_pci_error_handlers.cocci                   |  9 +++
 .../igb_pci_error_handlers.patch                   | 14 ----
 .../network/0042-pci_error_handlers/ngene.patch    | 14 ----
 .../network/0043-ndo_set_vf_rate/INFO              | 17 +++++
 .../network/0043-ndo_set_vf_rate/igb.patch         | 78 ----------------------
 .../0043-ndo_set_vf_rate/igb_set_vf_rate.patch     | 28 ++++++++
 .../network/0043-ndo_set_vf_rate/set_vf_rate.cocci | 50 ++++++++++++++
 27 files changed, 323 insertions(+), 377 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/cdc_ncm.patch
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/drivers_net_usb_usbnet.patch
 create mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/get_ts_info.cocci
 delete mode 100644 patches/collateral-evolutions/network/0017-get_ts_info/igb_get_ts_info.patch
 create mode 100644 patches/collateral-evolutions/network/0032-sriov_configure/sriov_configure.cocci
 delete mode 100644 patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch
 create mode 100644 patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci
 create mode 100644 patches/collateral-evolutions/network/0036-ethtool_eee/ethtool_eee.cocci
 delete mode 100644 patches/collateral-evolutions/network/0036-ethtool_eee/igb_ethtool_eee.patch
 create mode 100644 patches/collateral-evolutions/network/0037-ethtool_get_module/get_module.cocci
 delete mode 100644 patches/collateral-evolutions/network/0037-ethtool_get_module/igb_get_module.patch
 delete mode 100644 patches/collateral-evolutions/network/0039-ethtool_rxnfc/igb_rxnfc.patch
 create mode 100644 patches/collateral-evolutions/network/0039-ethtool_rxnfc/rxnfc.cocci
 create mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/devm_hwmon_device_register_with_groups.patch.cocci
 delete mode 100644 patches/collateral-evolutions/network/0041-devm_hwmon_device_register_with_groups/igb-devm_hwmon_device_register_with_groups.patch
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/alx.patch
Quoted 9 lines
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/atl1c.patch
 create mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.cocci
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/igb_pci_error_handlers.patch
 delete mode 100644 patches/collateral-evolutions/network/0042-pci_error_handlers/ngene.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/INFO
 delete mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/igb_set_vf_rate.patch
 create mode 100644 patches/collateral-evolutions/network/0043-ndo_set_vf_rate/set_vf_rate.cocci

Thank you for the patches, I applied and pushed them out.

hauke