renenable out-of-tree intel ethernet driver (e1000e, igb, ixgbe)
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 Jun 2018 13:03:26 +0000 (15:03 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 8 Jun 2018 09:58:18 +0000 (11:58 +0200)
There where just to much issues with the 4.15 in tree drivers for our
users [1]. The updated igb and ixgbe drivers are compatible with
4.15, the e1000e driver needed to be ported to the new internal
kernel timer API, which is pretty straight forward.

[1]: https://forum.proxmox.com/threads/4-15-based-test-kernel-for-pve-5-x-available.42097/page-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile
debian/rules
patches/intel/e1000e/e1000e_4.15-new-timer.patch [new file with mode: 0644]
patches/intel/igb/igb_4.10_max-mtu.patch [deleted file]
patches/intel/igb/igb_4.12_compat.patch [deleted file]

index c00260909f66a106d67526ae51cba0d055555965..934b634afd556d68a48a5fd912d4ed3d35c64df7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -58,9 +58,7 @@ ZFSDIR=pkg-zfs
 ZFSSRC=${ZFSONLINUX_SUBMODULE}/zfs-debian
 
 MODULES=modules
-#intel out-of-tree drivers disabled for now - incompatible with 4.15
-#MODULE_DIRS=${E1000EDIR} ${IGBDIR} ${IXGBEDIR} ${SPLDIR} ${ZFSDIR}
-MODULE_DIRS=${SPLDIR} ${ZFSDIR}
+MODULE_DIRS=${E1000EDIR} ${IGBDIR} ${IXGBEDIR} ${SPLDIR} ${ZFSDIR}
 
 # exported to debian/rules via debian/rules.d/dirs.mk
 DIRS=KERNEL_SRC E1000EDIR IGBDIR IXGBEDIR SPLDIR ZFSDIR MODULES
@@ -127,14 +125,13 @@ ${E1000EDIR}.prepared: ${E1000ESRC}
        tar --strip-components=1 -C ${BUILD_DIR}/${MODULES}/${E1000EDIR} -xf ${E1000ESRC}
        cd ${BUILD_DIR}/${MODULES}/${E1000EDIR}; patch -p1 < ../../../patches/intel/intel-module-gcc6-compat.patch
        cd ${BUILD_DIR}/${MODULES}/${E1000EDIR}; patch -p1 < ../../../patches/intel/e1000e/e1000e_4.10_max-mtu.patch
+       cd ${BUILD_DIR}/${MODULES}/${E1000EDIR}; patch -p1 < ../../../patches/intel/e1000e/e1000e_4.15-new-timer.patch
        touch $@
 
 ${IGBDIR}.prepared: ${IGBSRC}
        rm -rf ${BUILD_DIR}/${MODULES}/${IGBDIR} $@
        mkdir -p ${BUILD_DIR}/${MODULES}/${IGBDIR}
        tar --strip-components=1 -C ${BUILD_DIR}/${MODULES}/${IGBDIR} -xf ${IGBSRC}
-       cd ${BUILD_DIR}/${MODULES}/${IGBDIR}; patch -p1 < ../../../patches/intel/igb/igb_4.10_max-mtu.patch
-       cd ${BUILD_DIR}/${MODULES}/${IGBDIR}; patch -p1 < ../../../patches/intel/igb/igb_4.12_compat.patch
        touch $@
 
 ${IXGBEDIR}.prepared: ${IXGBESRC}
index 65b489480ce48365517e2bd641661c0a3c1822e8..6970fed3cdb047158f32c5b3a29c8e3b3bbb65e0 100755 (executable)
@@ -103,13 +103,12 @@ binary: install
        install -m 644 ${KERNEL_SRC}/System.map debian/${PVE_KERNEL_PKG}/boot/System.map-${KVNAME}
        install -m 644 ${KERNEL_SRC}/${KERNEL_IMAGE_PATH} debian/${PVE_KERNEL_PKG}/boot/${KERNEL_INSTALL_FILE}-${KVNAME}
        ${MAKE} -C ${KERNEL_SRC} INSTALL_MOD_PATH=${BUILD_DIR}/debian/${PVE_KERNEL_PKG}/ modules_install
-# disabled for now, incompatbile with 4.15
-#      ## install latest ibg driver
-#      install -m 644 ${MODULES}/igb.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/igb/
-#      # install latest ixgbe driver
-#      install -m 644 ${MODULES}/ixgbe.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/ixgbe/
-#      # install latest e1000e driver
-#      install -m 644 ${MODULES}/e1000e.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/e1000e/
+       ## install latest ibg driver
+       install -m 644 ${MODULES}/igb.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/igb/
+       # install latest ixgbe driver
+       install -m 644 ${MODULES}/ixgbe.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/ixgbe/
+       # install latest e1000e driver
+       install -m 644 ${MODULES}/e1000e.ko debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/e1000e/
        # install zfs drivers
        install -d -m 0755 debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/zfs
        install -m 644 $(addprefix ${MODULES}/,spl.ko splat.ko zfs.ko zavl.ko znvpair.ko zunicode.ko zcommon.ko zpios.ko icp.ko) debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/zfs
@@ -195,9 +194,7 @@ binary: install
        ln -sf /usr/src/linux-headers-${KVNAME} debian/${PVE_HEADER_PKG}/lib/modules/${KVNAME}/build
        touch $@
 
-# intel out-of-tree drivers disabled for now - incompatible with 4.15
-#.modules_compile_mark: $(addprefix ${MODULES}/,igb.ko ixgbe.ko e1000e.ko spl.ko zfs.ko)
-.modules_compile_mark: $(addprefix ${MODULES}/,spl.ko zfs.ko)
+.modules_compile_mark: $(addprefix ${MODULES}/,igb.ko ixgbe.ko e1000e.ko spl.ko zfs.ko)
        touch $@
 
 ${MODULES}/spl.ko: .compile_mark
diff --git a/patches/intel/e1000e/e1000e_4.15-new-timer.patch b/patches/intel/e1000e/e1000e_4.15-new-timer.patch
new file mode 100644 (file)
index 0000000..1583aa1
--- /dev/null
@@ -0,0 +1,53 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Thomas Lamprecht <t.lamprecht@proxmox.com>
+Date: Tue, 5 Jun 2018 11:16:29 +0200
+Subject: [PATCH] port to new internal kernel timer API
+
+Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
+---
+diff --git a/src/netdev.c b/src/netdev.c
+--- a/src/netdev.c
++++ b/src/netdev.c
+@@ -5389,9 +5389,10 @@
+  * Need to wait a few seconds after link up to get diagnostic information from
+  * the phy
+  **/
+-static void e1000_update_phy_info(unsigned long data)
++static void e1000_update_phy_info(struct timer_list *t)
+ {
+-      struct e1000_adapter *adapter = (struct e1000_adapter *)data;
++      struct e1000_adapter *adapter;
++      adapter = from_timer(adapter, t, phy_info_timer);
+       if (test_bit(__E1000_DOWN, &adapter->state))
+               return;
+@@ -5774,9 +5775,10 @@
+  * e1000_watchdog - Timer Call-back
+  * @data: pointer to adapter cast into an unsigned long
+  **/
+-static void e1000_watchdog(unsigned long data)
++static void e1000_watchdog(struct timer_list *t)
+ {
+-      struct e1000_adapter *adapter = (struct e1000_adapter *)data;
++      struct e1000_adapter *adapter;
++      adapter = from_timer(adapter, t, watchdog_timer);
+       /* Do the rest outside of interrupt context */
+       schedule_work(&adapter->watchdog_task);
+@@ -8348,13 +8348,9 @@
+               goto err_eeprom;
+       }
+-      init_timer(&adapter->watchdog_timer);
+-      adapter->watchdog_timer.function = e1000_watchdog;
+-      adapter->watchdog_timer.data = (unsigned long)adapter;
+-
+-      init_timer(&adapter->phy_info_timer);
+-      adapter->phy_info_timer.function = e1000_update_phy_info;
+-      adapter->phy_info_timer.data = (unsigned long)adapter;
++      timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0);
++
++      timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0);
+       INIT_WORK(&adapter->reset_task, e1000_reset_task);
+       INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);
diff --git a/patches/intel/igb/igb_4.10_max-mtu.patch b/patches/intel/igb/igb_4.10_max-mtu.patch
deleted file mode 100644 (file)
index d04ead5..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-diff --git a/src/e1000_defines.h b/src/e1000_defines.h
-index 6de3988..d58e12f 100644
---- a/src/e1000_defines.h
-+++ b/src/e1000_defines.h
-@@ -423,7 +423,8 @@
- #define ETHERNET_IEEE_VLAN_TYPE               0x8100  /* 802.3ac packet */
- #define ETHERNET_FCS_SIZE             4
--#define MAX_JUMBO_FRAME_SIZE          0x3F00
-+#define MAX_JUMBO_FRAME_SIZE          0x2600
-+#define MAX_STD_JUMBO_FRAME_SIZE      9216
- /* The datasheet maximum supported RX size is 9.5KB (9728 bytes) */
- #define MAX_RX_JUMBO_FRAME_SIZE               0x2600
- #define E1000_TX_PTR_GAP              0x1F
-diff --git a/src/igb_main.c b/src/igb_main.c
-index 2dff0f4..bbfe87e 100644
---- a/src/igb_main.c
-+++ b/src/igb_main.c
-@@ -2852,6 +2852,10 @@ static int igb_probe(struct pci_dev *pdev,
-       if (pci_using_dac)
-               netdev->features |= NETIF_F_HIGHDMA;
-+      /* MTU range: 68 - 9216 */
-+      netdev->min_mtu = ETH_MIN_MTU;
-+      netdev->max_mtu = MAX_STD_JUMBO_FRAME_SIZE;
-+
-       adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw);
- #ifdef DEBUG
-       if (adapter->dmac != IGB_DMAC_DISABLE)
-@@ -5832,17 +5836,6 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
-       struct pci_dev *pdev = adapter->pdev;
-       int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
--      if ((new_mtu < 68) || (max_frame > MAX_JUMBO_FRAME_SIZE)) {
--              dev_err(pci_dev_to_dev(pdev), "Invalid MTU setting\n");
--              return -EINVAL;
--      }
--
--#define MAX_STD_JUMBO_FRAME_SIZE 9238
--      if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
--              dev_err(pci_dev_to_dev(pdev), "MTU > 9216 not supported.\n");
--              return -EINVAL;
--      }
--
-       /* adjust max frame to be at least the size of a standard frame */
-       if (max_frame < (ETH_FRAME_LEN + ETH_FCS_LEN))
-               max_frame = ETH_FRAME_LEN + ETH_FCS_LEN;
diff --git a/patches/intel/igb/igb_4.12_compat.patch b/patches/intel/igb/igb_4.12_compat.patch
deleted file mode 100644 (file)
index efbfda6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/src/igb_main.c.orig b/src/igb_main.c
-index 3ee1ec7..c8adf04 100644
---- a/src/igb_main.c.orig
-+++ b/src/igb_main.c
-@@ -1047,8 +1047,10 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)
-                       for (i = 0; i < numvecs; i++)
-                               adapter->msix_entries[i].entry = i;
--                      err = pci_enable_msix(pdev,
--                                            adapter->msix_entries, numvecs);
-+                      err = pci_enable_msix_range(pdev,
-+                                                  adapter->msix_entries,
-+                                                  numvecs,
-+                                                  numvecs);
-                       if (err == 0)
-                               break;
-               }