aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2010-04-17 15:23:31 -0400
committerJesse Gross <jesse@nicira.com>2010-04-19 09:11:57 -0400
commit2736b84e2348090d4756f987db37aa7ddfcb50e0 (patch)
tree370558a10d3de15115ec8c3f3cce708be5fb8a58 /include
parentff6402a9f0d9ee4c29567b62938c82924d502b92 (diff)
tunneling: Add datapath GRE support.
Add a new vport type that implements GRE support inside of the datapath instead of relying on Linux devices. This provides greater scalability, performance, and control. The new GRE implementation supports nearly all features of the Linux implementation. It does not currently support multicast, NBMA tunnels, or non-Ethernet devices. This implementation of GRE has several important benefits over the existing Linux implementation. The first is simply that is not a Linux device. Linux devices are fairly heavy weight both in terms of memory consumption and interactions with the rest of the system (notifications, processes polling, etc.). There are many pieces of code that make assumptions about the maximum reasonable number of ports. Simply maintaining the state of several thousand devices is enough to full occupy the CPU. A tighter coupling between the GRE implementation and datapath also allows more flexibility. The key can be set and retrieved from the flow table, which allows even greater scalability. There will probably be additional use cases in the future.
Diffstat (limited to 'include')
-rw-r--r--include/openvswitch/gre.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/openvswitch/gre.h b/include/openvswitch/gre.h
index 2b24cf6e..27417bb3 100644
--- a/include/openvswitch/gre.h
+++ b/include/openvswitch/gre.h
@@ -43,6 +43,34 @@
#include <linux/if_tunnel.h>
#include <linux/version.h>
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <sys/types.h>
+#endif
+
+/* New GRE config. */
+
+#define GRE_F_IN_CSUM (1 << 0) /* Require incoming packets to have checksums. */
+#define GRE_F_OUT_CSUM (1 << 1) /* Checksum outgoing packets. */
+#define GRE_F_IN_KEY_MATCH (1 << 2) /* Store the key in tun_id to match in flow table. */
+#define GRE_F_OUT_KEY_ACTION (1 << 3) /* Get the key from a SET_TUNNEL action. */
+#define GRE_F_TOS_INHERIT (1 << 4) /* Inherit the ToS from the inner packet. */
+#define GRE_F_TTL_INHERIT (1 << 5) /* Inherit the TTL from the inner packet. */
+#define GRE_F_PMTUD (1 << 6) /* Enable path MTU discovery. */
+
+struct gre_port_config {
+ __u32 flags;
+ __be32 saddr;
+ __be32 daddr;
+ __be32 in_key;
+ __be32 out_key;
+ __u8 tos;
+ __u8 ttl;
+};
+
+/* Old GRE config. */
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
#define GRE_IOCTL_ONLY
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)