e1000e: Disable TSO on i219-LM card to increase speed
authorSebastian Basierski <sebastianx.basierski@intel.com>
Mon, 17 Apr 2023 20:53:45 +0000 (13:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Apr 2023 12:28:35 +0000 (14:28 +0200)
[ Upstream commit 67d47b95119ad589b0a0b16b88b1dd9a04061ced ]

While using i219-LM card currently it was only possible to achieve
about 60% of maximum speed due to regression introduced in Linux 5.8.
This was caused by TSO not being disabled by default despite commit
f29801030ac6 ("e1000e: Disable TSO for buffer overrun workaround").
Fix that by disabling TSO during driver probe.

Fixes: f29801030ac6 ("e1000e: Disable TSO for buffer overrun workaround")
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230417205345.1030801-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/e1000e/netdev.c

index 55cf2f6..db8e061 100644 (file)
@@ -5293,31 +5293,6 @@ static void e1000_watchdog_task(struct work_struct *work)
                                ew32(TARC(0), tarc0);
                        }
 
-                       /* disable TSO for pcie and 10/100 speeds, to avoid
-                        * some hardware issues
-                        */
-                       if (!(adapter->flags & FLAG_TSO_FORCE)) {
-                               switch (adapter->link_speed) {
-                               case SPEED_10:
-                               case SPEED_100:
-                                       e_info("10/100 speed: disabling TSO\n");
-                                       netdev->features &= ~NETIF_F_TSO;
-                                       netdev->features &= ~NETIF_F_TSO6;
-                                       break;
-                               case SPEED_1000:
-                                       netdev->features |= NETIF_F_TSO;
-                                       netdev->features |= NETIF_F_TSO6;
-                                       break;
-                               default:
-                                       /* oops */
-                                       break;
-                               }
-                               if (hw->mac.type == e1000_pch_spt) {
-                                       netdev->features &= ~NETIF_F_TSO;
-                                       netdev->features &= ~NETIF_F_TSO6;
-                               }
-                       }
-
                        /* enable transmits in the hardware, need to do this
                         * after setting TARC(0)
                         */
@@ -7532,6 +7507,32 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                            NETIF_F_RXCSUM |
                            NETIF_F_HW_CSUM);
 
+       /* disable TSO for pcie and 10/100 speeds to avoid
+        * some hardware issues and for i219 to fix transfer
+        * speed being capped at 60%
+        */
+       if (!(adapter->flags & FLAG_TSO_FORCE)) {
+               switch (adapter->link_speed) {
+               case SPEED_10:
+               case SPEED_100:
+                       e_info("10/100 speed: disabling TSO\n");
+                       netdev->features &= ~NETIF_F_TSO;
+                       netdev->features &= ~NETIF_F_TSO6;
+                       break;
+               case SPEED_1000:
+                       netdev->features |= NETIF_F_TSO;
+                       netdev->features |= NETIF_F_TSO6;
+                       break;
+               default:
+                       /* oops */
+                       break;
+               }
+               if (hw->mac.type == e1000_pch_spt) {
+                       netdev->features &= ~NETIF_F_TSO;
+                       netdev->features &= ~NETIF_F_TSO6;
+               }
+       }
+
        /* Set user-changeable features (subset of all device features) */
        netdev->hw_features = netdev->features;
        netdev->hw_features |= NETIF_F_RXFCS;