diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-06-27 03:47:37 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 01:15:52 -0400 |
commit | d212f87b068c9d72065ef579d85b5ee6b8b59381 (patch) | |
tree | a194d5c667c277c7ea5392c9cf97857a0cd1d321 /net/bridge | |
parent | d3d6dd3adaaad71eae20902ed81808a66a40a5b9 (diff) |
[NET]: IPV6 checksum offloading in network devices
The existing model for checksum offload does not correctly handle
devices that can offload IPV4 and IPV6 only. The NETIF_F_HW_CSUM flag
implies device can do any arbitrary protocol.
This patch:
* adds NETIF_F_IPV6_CSUM for those devices
* fixes bnx2 and tg3 devices that need it
* add NETIF_F_IPV6_CSUM to ipv6 output (incl GSO)
* fixes assumptions about NETIF_F_ALL_CSUM in nat
* adjusts bridge union of checksumming computation
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_if.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 849deaf14108..7b4ce9113be2 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -368,10 +368,18 @@ void br_features_recompute(struct net_bridge *br) | |||
368 | list_for_each_entry(p, &br->port_list, list) { | 368 | list_for_each_entry(p, &br->port_list, list) { |
369 | unsigned long feature = p->dev->features; | 369 | unsigned long feature = p->dev->features; |
370 | 370 | ||
371 | /* if device needs checksumming, downgrade to hw checksumming */ | ||
371 | if (checksum & NETIF_F_NO_CSUM && !(feature & NETIF_F_NO_CSUM)) | 372 | if (checksum & NETIF_F_NO_CSUM && !(feature & NETIF_F_NO_CSUM)) |
372 | checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM; | 373 | checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM; |
374 | |||
375 | /* if device can't do all checksum, downgrade to ipv4/ipv6 */ | ||
373 | if (checksum & NETIF_F_HW_CSUM && !(feature & NETIF_F_HW_CSUM)) | 376 | if (checksum & NETIF_F_HW_CSUM && !(feature & NETIF_F_HW_CSUM)) |
374 | checksum ^= NETIF_F_HW_CSUM | NETIF_F_IP_CSUM; | 377 | checksum ^= NETIF_F_HW_CSUM |
378 | | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | ||
379 | |||
380 | if (checksum & NETIF_F_IPV6_CSUM && !(feature & NETIF_F_IPV6_CSUM)) | ||
381 | checksum &= ~NETIF_F_IPV6_CSUM; | ||
382 | |||
375 | if (!(feature & NETIF_F_IP_CSUM)) | 383 | if (!(feature & NETIF_F_IP_CSUM)) |
376 | checksum = 0; | 384 | checksum = 0; |
377 | 385 | ||