aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2011-01-09 01:23:30 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-10 02:35:33 -0500
commit9497a0518e8183959e45da05f317f1cb36f2cd7c (patch)
tree7215c99aa1927d2357f53431d590f77ef8b3e0ef
parenteee3a96c6368f47df8df5bd4ed1843600652b337 (diff)
net offloading: Accept NETIF_F_HW_CSUM for all protocols.
We currently only have software fallback for one type of checksum: the TCP/UDP one's complement. This means that a protocol that uses hardware offloading for a different type of checksum (FCoE, SCTP) must directly check the device's features and do the right thing ahead of time. By the time we get to dev_can_checksum(), we're only deciding whether to apply the one algorithm in software or hardware. NETIF_F_HW_CSUM has the same capabilities as the software version, so we should always use it if present. The primary advantage of this is multiply tagged vlans can use hardware checksumming. Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index a215269d2e35..d8befd06da04 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1734,7 +1734,7 @@ EXPORT_SYMBOL(netif_device_attach);
1734 1734
1735static bool can_checksum_protocol(unsigned long features, __be16 protocol) 1735static bool can_checksum_protocol(unsigned long features, __be16 protocol)
1736{ 1736{
1737 return ((features & NETIF_F_NO_CSUM) || 1737 return ((features & NETIF_F_GEN_CSUM) ||
1738 ((features & NETIF_F_V4_CSUM) && 1738 ((features & NETIF_F_V4_CSUM) &&
1739 protocol == htons(ETH_P_IP)) || 1739 protocol == htons(ETH_P_IP)) ||
1740 ((features & NETIF_F_V6_CSUM) && 1740 ((features & NETIF_F_V6_CSUM) &&