From: Nisar Sayed Date: Tue, 9 May 2017 17:51:42 +0000 (+0100) Subject: According to RFC 2460, IPv6 UDP calculated checksum yields a result X-Git-Tag: archive/raspbian/4.9.82-1+deb9u3+rpi1_jessie~5^2~236 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=75fb754c21075459a3395b1df9770248a6a29bb2;p=linux-4.9.git According to RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be changed to 0xffff, however this feature is not supported by smsc95xx family hence enable csum offload only for IPv4 TCP/UDP packets. Signed-off-by: Nisar Sayed Reported-by: popcorn mix --- diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index f6661e388f6e..b84e98508b5d 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -694,7 +694,7 @@ static int smsc95xx_set_features(struct net_device *netdev, if (ret < 0) return ret; - if (features & NETIF_F_HW_CSUM) + if (features & NETIF_F_IP_CSUM) read_buf |= Tx_COE_EN_; else read_buf &= ~Tx_COE_EN_; @@ -1342,12 +1342,16 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) spin_lock_init(&pdata->mac_cr_lock); + /* RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be + * changed to 0xffff, this feature is not supported by smsc95xx family, + * hence enable csum offload only for IPv4 TCP/UDP packets. + */ if (DEFAULT_TX_CSUM_ENABLE) - dev->net->features |= NETIF_F_HW_CSUM; + dev->net->features |= NETIF_F_IP_CSUM; if (DEFAULT_RX_CSUM_ENABLE) dev->net->features |= NETIF_F_RXCSUM; - dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM; + dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM; smsc95xx_init_mac_address(dev);