Commit 5ff0feac authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

sky2: fix checksum bit management on some chips

The newer flavors of Yukon II use a different method for receive
checksum offload. This is indicated in the driver by the SKY2_HW_NEW_LE
flag. On these newer chips, the BMU_ENA_RX_CHKSUM should not be set.

The driver would get incorrectly toggle the bit, enabling the old
checksum logic on these chips and cause a BUG_ON() assertion. If
receive checksum was toggled via ethtool.
Reported-by: default avatarKirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8bd74516
...@@ -4381,10 +4381,12 @@ static int sky2_set_features(struct net_device *dev, netdev_features_t features) ...@@ -4381,10 +4381,12 @@ static int sky2_set_features(struct net_device *dev, netdev_features_t features)
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = netdev_priv(dev);
netdev_features_t changed = dev->features ^ features; netdev_features_t changed = dev->features ^ features;
if (changed & NETIF_F_RXCSUM) { if ((changed & NETIF_F_RXCSUM) &&
bool on = features & NETIF_F_RXCSUM; !(sky2->hw->flags & SKY2_HW_NEW_LE)) {
sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), sky2_write32(sky2->hw,
on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); Q_ADDR(rxqaddr[sky2->port], Q_CSR),
(features & NETIF_F_RXCSUM)
? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM);
} }
if (changed & NETIF_F_RXHASH) if (changed & NETIF_F_RXHASH)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment