]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/net-netif_f_hw_csum-does-not-imply-fcoe-crc-offload.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / net-netif_f_hw_csum-does-not-imply-fcoe-crc-offload.patch
1 From 66c68bcc489fadd4f5e8839e966e3a366e50d1d5 Mon Sep 17 00:00:00 2001
2 From: Ben Hutchings <bhutchings@solarflare.com>
3 Date: Fri, 22 Oct 2010 04:38:26 +0000
4 Subject: net: NETIF_F_HW_CSUM does not imply FCoE CRC offload
5
6 From: Ben Hutchings <bhutchings@solarflare.com>
7
8 commit 66c68bcc489fadd4f5e8839e966e3a366e50d1d5 upstream.
9
10 NETIF_F_HW_CSUM indicates the ability to update an TCP/IP-style 16-bit
11 checksum with the checksum of an arbitrary part of the packet data,
12 whereas the FCoE CRC is something entirely different.
13
14 Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18 ---
19 net/core/dev.c | 6 +++---
20 1 file changed, 3 insertions(+), 3 deletions(-)
21
22 --- a/net/core/dev.c
23 +++ b/net/core/dev.c
24 @@ -1648,10 +1648,10 @@ EXPORT_SYMBOL(netif_device_attach);
25
26 static bool can_checksum_protocol(unsigned long features, __be16 protocol)
27 {
28 - return ((features & NETIF_F_GEN_CSUM) ||
29 - ((features & NETIF_F_IP_CSUM) &&
30 + return ((features & NETIF_F_NO_CSUM) ||
31 + ((features & NETIF_F_V4_CSUM) &&
32 protocol == htons(ETH_P_IP)) ||
33 - ((features & NETIF_F_IPV6_CSUM) &&
34 + ((features & NETIF_F_V6_CSUM) &&
35 protocol == htons(ETH_P_IPV6)) ||
36 ((features & NETIF_F_FCOE_CRC) &&
37 protocol == htons(ETH_P_FCOE)));