[ovs-dev] [PATCH 1/8] gre: Disable checksums by default.

Jesse Gross jesse at nicira.com
Wed Aug 18 07:08:45 UTC 2010


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 checkums this makes it consistent with
GRE.

Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 lib/netdev-gre.c     |    8 +++-----
 vswitchd/vswitch.xml |    6 +++---
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/lib/netdev-gre.c b/lib/netdev-gre.c
index aecc77e..69411db 100644
--- a/lib/netdev-gre.c
+++ b/lib/netdev-gre.c
@@ -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")) {
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 3b50015..36964c8 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -442,7 +442,7 @@
           <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
@@ -506,8 +506,8 @@
             <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.  Default is disabled,
+                set to <code>true</code> to enable.</dd>
             </dl>
             <dl>
               <dt><code>pmtud</code></dt>
-- 
1.7.0.4





More information about the dev mailing list