From bd1bcd39a51c6110a94392ab1551b36b8df6bc59 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Thu, 12 Aug 2010 23:31:03 -0400 Subject: [PATCH] gre: Disable checksums by default. 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 --- lib/netdev-gre.c | 8 +++----- vswitchd/vswitch.xml | 10 +++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/netdev-gre.c b/lib/netdev-gre.c index aecc77ed..69411dbd 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 3b500151..f3864047 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -442,7 +442,7 @@
tap
A TUN/TAP device managed by Open vSwitch.
gre
-
An Ethernet over RFC 1702 Generic Routing Encapsulation over IPv4 +
An Ethernet over RFC 2890 Generic Routing Encapsulation over IPv4 tunnel. Each tunnel must be uniquely identified by the combination of remote_ip, local_ip, and in_key. Note that if two ports are defined that are @@ -506,8 +506,12 @@
csum
Optional. Compute GRE checksums for outgoing packets and - require checksums for incoming packets. Default is enabled, - set to false to disable.
+ 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 true to enable.
pmtud
-- 2.30.2