tunneling: Allow disabling tunnel header caching.
authorJesse Gross <jesse@nicira.com>
Mon, 30 Aug 2010 22:34:04 +0000 (15:34 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 22 Sep 2010 20:43:02 +0000 (13:43 -0700)
Tunnel header caching significantly improves performance by bypassing
much of the transmit path.  However, in some special cases or for
debugging it may be desirable to traverse the entire IP stack.  This
exposes that as an option (default is to enable header caching).

Signed-off-by: Jesse Gross <jesse@nicira.com>
Reviewed-by: Ben Pfaff <blp@nicira.com>
lib/netdev-tunnel.c
vswitchd/vswitch.xml

index d0ecd98..fdc1d97 100644 (file)
@@ -66,6 +66,7 @@ parse_config(const char *name, const char *type, const struct shash *args,
     memset(config, 0, sizeof *config);
 
     config->flags |= TNL_F_PMTUD;
     memset(config, 0, sizeof *config);
 
     config->flags |= TNL_F_PMTUD;
+    config->flags |= TNL_F_HDR_CACHE;
 
     SHASH_FOR_EACH (node, args) {
         if (!strcmp(node->name, "remote_ip")) {
 
     SHASH_FOR_EACH (node, args) {
         if (!strcmp(node->name, "remote_ip")) {
@@ -121,6 +122,10 @@ parse_config(const char *name, const char *type, const struct shash *args,
             if (!strcmp(node->data, "false")) {
                 config->flags &= ~TNL_F_PMTUD;
             }
             if (!strcmp(node->data, "false")) {
                 config->flags &= ~TNL_F_PMTUD;
             }
+        } else if (!strcmp(node->name, "header_cache")) {
+            if (!strcmp(node->data, "false")) {
+                config->flags &= ~TNL_F_HDR_CACHE;
+            }
         } else {
             VLOG_WARN("%s: unknown %s argument '%s'", name, type, node->name);
         }
         } else {
             VLOG_WARN("%s: unknown %s argument '%s'", name, type, node->name);
         }
index 6e25576..86fd3f9 100644 (file)
                 compliance with the IEEE 802.1D specification for bridges.
                 Default is enabled, set to <code>false</code> to disable.</dd>
             </dl>
                 compliance with the IEEE 802.1D specification for bridges.
                 Default is enabled, set to <code>false</code> to disable.</dd>
             </dl>
+            <dl>
+              <dt><code>header_cache</code></dt>
+              <dd>Optional.  Enable caching of tunnel headers and the output
+               path.  This can lead to a significant performance increase
+               without changing behavior.  In general it should not be
+               necessary to adjust this setting.  However, the caching can
+               bypass certain components of the IP stack (such as IP tables)
+               and it may be useful to disable it if these features are
+               required or as a debugging measure.  Default is enabled, set to
+               <code>false</code> to disable.</dd>
+            </dl>
           </dd>
           <dt><code>capwap</code></dt>
           <dd>Ethernet tunneling over the UDP transport portion of CAPWAP
           </dd>
           <dt><code>capwap</code></dt>
           <dd>Ethernet tunneling over the UDP transport portion of CAPWAP
                 compliance with the IEEE 802.1D specification for bridges.
                 Default is enabled, set to <code>false</code> to disable.</dd>
             </dl>
                 compliance with the IEEE 802.1D specification for bridges.
                 Default is enabled, set to <code>false</code> to disable.</dd>
             </dl>
+            <dl>
+              <dt><code>header_cache</code></dt>
+              <dd>Optional.  Enable caching of tunnel headers and the output
+               path.  This can lead to a significant performance increase
+               without changing behavior.  In general it should not be
+               necessary to adjust this setting.  However, the caching can
+               bypass certain components of the IP stack (such as IP tables)
+               and it may be useful to disable it if these features are
+               required or as a debugging measure.  Default is enabled, set to
+               <code>false</code> to disable.</dd>
+            </dl>
           </dd>
           <dt><code>patch</code></dt>
           <dd>
           </dd>
           <dt><code>patch</code></dt>
           <dd>