summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Assmann <sassmann@kpanic.de>2015-02-25 15:20:51 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2015-04-06 13:57:19 +0200
commit4596caaeed9d638c66a4a8c6cf1693cc7dee697c (patch)
tree864de7d00ffd2b0a90a1a9d607ae22946469a1b4
parentc0d81c96b893c76514c00d052064604c6d037aec (diff)
backports: replace struct net_device_ops set_vf_spoofchk changes with smpl patch
Signed-off-by: Stefan Assmann <sassmann@kpanic.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch49
-rw-r--r--patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci41
2 files changed, 41 insertions, 49 deletions
diff --git a/patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch b/patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch
deleted file mode 100644
index 879312dc..00000000
--- a/patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/igb_ndo_set_vf_spoofchk.patch
+++ /dev/null
@@ -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;
- }
-
diff --git a/patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci b/patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci
new file mode 100644
index 00000000..7be32c0b
--- /dev/null
+++ b/patches/collateral-evolutions/network/0034-ndo_set_vf_spoofchk/set_vf_spoofchk.cocci
@@ -0,0 +1,41 @@
+@r1@
+identifier s, func;
+@@
+
+struct net_device_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+.ndo_set_vf_spoofchk = func,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
+};
+
+@r2@
+identifier s, func2;
+@@
+
+struct net_device_ops s = {
+.ndo_get_vf_config = func2,
+};
+
+// ----------------------------------------------------------------------
+
+@@
+identifier r1.func;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+func(...) { ... }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
+
+@@
+identifier r2.func2, ivi;
+expression assign;
+@@
+
+func2(... ,struct ifla_vf_info *ivi)
+{
+ <...
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+ ivi->spoofchk = assign;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
+ ...>
+}