Skip to content

Commit 95099c5

Browse files
hkallweitdavem330
authored andcommitted
r8169: change back SG and TSO to be disabled by default
There has been a number of reports that using SG/TSO on different chip versions results in tx timeouts. However for a lot of people SG/TSO works fine. Therefore disable both features by default, but allow users to enable them. Use at own risk! Fixes: 93681cd ("r8169: enable HW csum and TSO") Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 536fab5 commit 95099c5

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5441,9 +5441,8 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
54415441

54425442
netif_napi_add(dev, &tp->napi, rtl8169_poll, NAPI_POLL_WEIGHT);
54435443

5444-
dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
5445-
NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX |
5446-
NETIF_F_HW_VLAN_CTAG_RX;
5444+
dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
5445+
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
54475446
dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
54485447
NETIF_F_HIGHDMA;
54495448
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
@@ -5460,26 +5459,26 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
54605459
/* Disallow toggling */
54615460
dev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_RX;
54625461

5462+
if (rtl_chip_supports_csum_v2(tp))
5463+
dev->hw_features |= NETIF_F_IPV6_CSUM;
5464+
5465+
dev->features |= dev->hw_features;
5466+
5467+
/* There has been a number of reports that using SG/TSO results in
5468+
* tx timeouts. However for a lot of people SG/TSO works fine.
5469+
* Therefore disable both features by default, but allow users to
5470+
* enable them. Use at own risk!
5471+
*/
54635472
if (rtl_chip_supports_csum_v2(tp)) {
5464-
dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
5473+
dev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6;
54655474
dev->gso_max_size = RTL_GSO_MAX_SIZE_V2;
54665475
dev->gso_max_segs = RTL_GSO_MAX_SEGS_V2;
54675476
} else {
5477+
dev->hw_features |= NETIF_F_SG | NETIF_F_TSO;
54685478
dev->gso_max_size = RTL_GSO_MAX_SIZE_V1;
54695479
dev->gso_max_segs = RTL_GSO_MAX_SEGS_V1;
54705480
}
54715481

5472-
/* RTL8168e-vl and one RTL8168c variant are known to have a
5473-
* HW issue with TSO.
5474-
*/
5475-
if (tp->mac_version == RTL_GIGA_MAC_VER_34 ||
5476-
tp->mac_version == RTL_GIGA_MAC_VER_22) {
5477-
dev->vlan_features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
5478-
dev->hw_features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
5479-
}
5480-
5481-
dev->features |= dev->hw_features;
5482-
54835482
dev->hw_features |= NETIF_F_RXALL;
54845483
dev->hw_features |= NETIF_F_RXFCS;
54855484

0 commit comments

Comments
 (0)