From: Ben Hutchings Date: Fri, 22 Oct 2010 04:38:26 +0000 (+0000) Subject: net: NETIF_F_HW_CSUM does not imply FCoE CRC offload X-Git-Tag: firefly_0821_release~10186^2~716 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0785ba875cf1728a62c91856d312f5d89f8d2679;p=firefly-linux-kernel-4.4.55.git net: NETIF_F_HW_CSUM does not imply FCoE CRC offload commit 66c68bcc489fadd4f5e8839e966e3a366e50d1d5 upstream. NETIF_F_HW_CSUM indicates the ability to update an TCP/IP-style 16-bit checksum with the checksum of an arbitrary part of the packet data, whereas the FCoE CRC is something entirely different. Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/dev.c b/net/core/dev.c index 915d0aeb4616..d04cd93f22b5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1484,10 +1484,10 @@ EXPORT_SYMBOL(netif_device_attach); static bool can_checksum_protocol(unsigned long features, __be16 protocol) { - return ((features & NETIF_F_GEN_CSUM) || - ((features & NETIF_F_IP_CSUM) && + return ((features & NETIF_F_NO_CSUM) || + ((features & NETIF_F_V4_CSUM) && protocol == htons(ETH_P_IP)) || - ((features & NETIF_F_IPV6_CSUM) && + ((features & NETIF_F_V6_CSUM) && protocol == htons(ETH_P_IPV6)) || ((features & NETIF_F_FCOE_CRC) && protocol == htons(ETH_P_FCOE)));