gre: Disable checksums by default.
authorJesse Gross <jesse@nicira.com>
Fri, 13 Aug 2010 03:31:03 +0000 (23:31 -0400)
committerJesse Gross <jesse@nicira.com>
Sat, 21 Aug 2010 02:43:06 +0000 (19:43 -0700)
GRE checksums aren't really all that useful because they only
add value for the GRE and inner Ethernet header.  However, they
are expensive since they cover the entire packet, even though
most of the data is protected by L3 and L4 checksums.  Therefore
disable checksumming by default to improve performance.  In addition,
since CAPWAP doesn't support checksums this makes it consistent with
GRE.

Signed-off-by: Jesse Gross <jesse@nicira.com>
lib/netdev-gre.c
vswitchd/vswitch.xml

index aecc77e..69411db 100644 (file)
@@ -61,8 +61,6 @@ parse_config(const char *name, const struct shash *args,
 
     memset(config, 0, sizeof *config);
 
-    config->flags |= GRE_F_IN_CSUM;
-    config->flags |= GRE_F_OUT_CSUM;
     config->flags |= GRE_F_PMTUD;
 
     SHASH_FOR_EACH (node, args) {
@@ -112,9 +110,9 @@ parse_config(const char *name, const struct shash *args,
                 config->ttl = atoi(node->data);
             }
         } else if (!strcmp(node->name, "csum")) {
-            if (!strcmp(node->data, "false")) {
-                config->flags &= ~GRE_F_IN_CSUM;
-                config->flags &= ~GRE_F_OUT_CSUM;
+            if (!strcmp(node->data, "true")) {
+                config->flags |= GRE_F_IN_CSUM;
+                config->flags |= GRE_F_OUT_CSUM;
             }
         } else if (!strcmp(node->name, "pmtud")) {
             if (!strcmp(node->data, "false")) {
index 3b50015..f386404 100644 (file)
           <dt><code>tap</code></dt>
           <dd>A TUN/TAP device managed by Open vSwitch.</dd>
           <dt><code>gre</code></dt>
-          <dd>An Ethernet over RFC 1702 Generic Routing Encapsulation over IPv4
+          <dd>An Ethernet over RFC 2890 Generic Routing Encapsulation over IPv4
              tunnel.  Each tunnel must be uniquely identified by the
              combination of <code>remote_ip</code>, <code>local_ip</code>, and
              <code>in_key</code>.  Note that if two ports are defined that are
             <dl>
               <dt><code>csum</code></dt>
               <dd>Optional.  Compute GRE checksums for outgoing packets and
-                require checksums for incoming packets.  Default is enabled,
-                set to <code>false</code> to disable.</dd>
+                require checksums for incoming packets.  Note that GRE checksums
+                impose a significant performance penalty as they cover the
+                entire packet.  As the contents of the packet is typically
+                covered by L3 and L4 checksums, this additional checksum only
+                adds value for the GRE and encapsulated Ethernet headers.
+                Default is disabled, set to <code>true</code> to enable.</dd>
             </dl>
             <dl>
               <dt><code>pmtud</code></dt>