backports: igb fixes for linux-3.1
authorStefan Assmann <sassmann@kpanic.de>
Wed, 29 Jan 2014 09:19:08 +0000 (10:19 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 31 Jan 2014 23:31:30 +0000 (00:31 +0100)
- add IFF_UNICAST_FLT define
- add PCI_DEV_FLAGS_ASSIGNED define
- add skb_frag_size_sub()
- add skb_frag_address()
- add patches/collateral-evolutions/network/84-ethernet/0011-igb_ethtool_ops.patch
- add patches/collateral-evolutions/network/84-ethernet/0012-igb_ndo_set_vf_spoofchk.patch

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/if.h
backport/backport-include/linux/pci.h
backport/backport-include/linux/skbuff.h
patches/collateral-evolutions/network/84-ethernet/0011-igb_ethtool_ops.patch [new file with mode: 0644]
patches/collateral-evolutions/network/84-ethernet/0012-igb_ndo_set_vf_spoofchk.patch [new file with mode: 0644]

index f23d2b848c292d8dbd0a3805e2bfc94bfd78c281..a0725798b223c7a409d54f32581f04ab2368e8bc 100644 (file)
@@ -37,4 +37,8 @@
 #define IFF_SUPP_NOFCS 0x80000         /* device supports sending custom FCS */
 #endif
 
+#ifndef IFF_UNICAST_FLT
+#define IFF_UNICAST_FLT        0x20000         /* Supports unicast filtering   */
+#endif
+
 #endif /* _BACKPORT_LINUX_IF_H */
index 5201f1b064ddac793b57b38f3adb47990f3aeefc..2d4822a9078320f7c12d199a10998e58505d0e67 100644 (file)
@@ -178,6 +178,23 @@ bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
        .subvendor = (subvend), .subdevice = (subdev)
 #endif /* PCI_DEVICE_SUB */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+#define pci_dev_flags LINUX_BACKPORT(pci_dev_flags)
+#define PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG LINUX_BACKPORT(PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG)
+#define PCI_DEV_FLAGS_NO_D3 LINUX_BACKPORT(PCI_DEV_FLAGS_NO_D3)
+#define PCI_DEV_FLAGS_ASSIGNED LINUX_BACKPORT(PCI_DEV_FLAGS_ASSIGNED)
+enum pci_dev_flags {
+       /* INTX_DISABLE in PCI_COMMAND register disables MSI
+        * generation too.
+        */
+       PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1,
+       /* Device configuration is irrevocably lost if disabled into D3 */
+       PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2,
+       /* Provide indication device is assigned by a Virtual Machine Manager */
+       PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4,
+};
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0) */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
 #define pci_sriov_set_totalvfs LINUX_BACKPORT(pci_sriov_set_totalvfs)
 int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
index c1b27537604be1b939c8f6ab28ddc437272e36d9..7ea44f5e21147341899c823f5491a1f478250b6c 100644 (file)
@@ -224,6 +224,27 @@ static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
                     skb = skb->next)
 #endif /* < 2.6.28 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+#define skb_frag_size_sub LINUX_BACKPORT(skb_frag_size_sub)
+static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
+{
+       frag->size -= delta;
+}
+
+/**
+ * skb_frag_address - gets the address of the data contained in a paged fragment
+ * @frag: the paged fragment buffer
+ *
+ * Returns the address of the data within @frag. The page must already
+ * be mapped.
+ */
+#define skb_frag_address LINUX_BACKPORT(skb_frag_address)
+static inline void *skb_frag_address(const skb_frag_t *frag)
+{
+       return page_address(skb_frag_page(frag)) + frag->page_offset;
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0) */
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) && LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
 /**
  *     __skb_alloc_pages - allocate pages for ps-rx on a skb and preserve pfmemalloc data
diff --git a/patches/collateral-evolutions/network/84-ethernet/0011-igb_ethtool_ops.patch b/patches/collateral-evolutions/network/84-ethernet/0011-igb_ethtool_ops.patch
new file mode 100644 (file)
index 0000000..81fc2df
--- /dev/null
@@ -0,0 +1,31 @@
+diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
+index 5e519ce..9f61f1d 100644
+--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
++++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
+@@ -2413,6 +2413,7 @@ static int igb_get_ts_info(struct net_de
+ }
+ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+ static int igb_get_rss_hash_opts(struct igb_adapter *adapter,
+                                struct ethtool_rxnfc *cmd)
+ {
+@@ -2591,6 +2592,7 @@ static int igb_set_rxnfc(struct net_devi
+       return ret;
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) */
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+ static int igb_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
+@@ -3016,8 +3018,10 @@ static const struct ethtool_ops igb_etht
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+       .get_ts_info            = igb_get_ts_info,
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
+       .get_rxnfc              = igb_get_rxnfc,
+       .set_rxnfc              = igb_set_rxnfc,
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+       .get_eee                = igb_get_eee,
+       .set_eee                = igb_set_eee,
diff --git a/patches/collateral-evolutions/network/84-ethernet/0012-igb_ndo_set_vf_spoofchk.patch b/patches/collateral-evolutions/network/84-ethernet/0012-igb_ndo_set_vf_spoofchk.patch
new file mode 100644 (file)
index 0000000..dec9a83
--- /dev/null
@@ -0,0 +1,51 @@
+diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
+index 35ac7d8..e609f71 100644
+--- a/drivers/net/ethernet/intel/igb/igb_main.c
++++ b/drivers/net/ethernet/intel/igb/igb_main.c
+@@ -182,8 +182,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 *netdev, int vf, int tx_rate);
++#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 *);
+@@ -2056,7 +2058,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_tx_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,
+@@ -7854,6 +7858,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)
+ {
+@@ -7880,6 +7885,7 @@ static int igb_ndo_set_vf_spoofchk(struc
+       adapter->vf_data[vf].spoofchk_enabled = setting;
+       return E1000_SUCCESS;
+ }
++#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)
+@@ -7892,7 +7898,9 @@ static int igb_ndo_get_vf_config(struct
+       ivi->tx_rate = adapter->vf_data[vf].tx_rate;
+       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;
+ }