aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-06-22 06:07:29 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-23 05:07:36 -0400
commit37c3185a02d4b85fbe134bf5204535405dd2c957 (patch)
tree7712fb706bb446b5b6a8ae25f365b4e135d9a1fb /net/bridge
parentf4c50d990dcf11a296679dc05de3873783236711 (diff)
[NET]: Added GSO toggle
This patch adds a generic segmentation offload toggle that can be turned on/off for each net device. For now it only supports in TCPv4. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_if.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index fdec773f5b52..07956ecf545e 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -376,15 +376,20 @@ void br_features_recompute(struct net_bridge *br)
376 features = br->feature_mask & ~NETIF_F_ALL_CSUM; 376 features = br->feature_mask & ~NETIF_F_ALL_CSUM;
377 377
378 list_for_each_entry(p, &br->port_list, list) { 378 list_for_each_entry(p, &br->port_list, list) {
379 if (checksum & NETIF_F_NO_CSUM && 379 unsigned long feature = p->dev->features;
380 !(p->dev->features & NETIF_F_NO_CSUM)) 380
381 if (checksum & NETIF_F_NO_CSUM && !(feature & NETIF_F_NO_CSUM))
381 checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM; 382 checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;
382 if (checksum & NETIF_F_HW_CSUM && 383 if (checksum & NETIF_F_HW_CSUM && !(feature & NETIF_F_HW_CSUM))
383 !(p->dev->features & NETIF_F_HW_CSUM))
384 checksum ^= NETIF_F_HW_CSUM | NETIF_F_IP_CSUM; 384 checksum ^= NETIF_F_HW_CSUM | NETIF_F_IP_CSUM;
385 if (!(p->dev->features & NETIF_F_IP_CSUM)) 385 if (!(feature & NETIF_F_IP_CSUM))
386 checksum = 0; 386 checksum = 0;
387 features &= p->dev->features; 387
388 if (feature & NETIF_F_GSO)
389 feature |= NETIF_F_TSO;
390 feature |= NETIF_F_GSO;
391
392 features &= feature;
388 } 393 }
389 394
390 br->dev->features = features | checksum | NETIF_F_LLTX; 395 br->dev->features = features | checksum | NETIF_F_LLTX;