Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

stephen hemminger and committed by
David S. Miller
5ff0feac 8bd74516

+6 -4
+6 -4
drivers/net/ethernet/marvell/sky2.c
··· 4381 4381 struct sky2_port *sky2 = netdev_priv(dev); 4382 4382 netdev_features_t changed = dev->features ^ features; 4383 4383 4384 - if (changed & NETIF_F_RXCSUM) { 4385 - bool on = features & NETIF_F_RXCSUM; 4386 - sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), 4387 - on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); 4384 + if ((changed & NETIF_F_RXCSUM) && 4385 + !(sky2->hw->flags & SKY2_HW_NEW_LE)) { 4386 + sky2_write32(sky2->hw, 4387 + Q_ADDR(rxqaddr[sky2->port], Q_CSR), 4388 + (features & NETIF_F_RXCSUM) 4389 + ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); 4388 4390 } 4389 4391 4390 4392 if (changed & NETIF_F_RXHASH)