summaryrefslogtreecommitdiff
path: root/include/linux/openvswitch.h
diff options
context:
space:
mode:
authorKyle Mestery <kmestery@cisco.com>2012-10-20 12:15:24 -0700
committerPravin B Shelar <pshelar@nicira.com>2012-10-20 12:15:24 -0700
commit356af50bc2a81305002feb94f04fd0dea9e9eb8f (patch)
treebea0f83dd5f3ac0d0346532c9e1793c8d13dd064 /include/linux/openvswitch.h
parent4206b80f6444ceef47ceb9e1a6b88a40eabacb1f (diff)
downloadopenvswitch-356af50bc2a81305002feb94f04fd0dea9e9eb8f.tar.gz
datapath: Add support for tun_key to Open vSwitch datapath
This is a first pass at providing a tun_key which can be used as the basis for flow-based tunnelling. The tun_key includes and replaces the tun_id in both struct ovs_skb_cb and struct sw_tun_key. This patch allows all existing tun_id behaviour to still work. Existing users of tun_id are redirected to tun_key->tun_id to retain compatibility. However, when the userspace code is updated to make use of the new tun_key, the old behaviour will be deprecated and removed. NOTE: With these changes, the tunneling code no longer assumes input and output keys are symmetric. If they are not, PMTUD needs to be disabled for tunneling to work. Signed-off-by: Kyle Mestery <kmestery@cisco.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/linux/openvswitch.h')
-rw-r--r--include/linux/openvswitch.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h
index 294f6d08b..89feb61f6 100644
--- a/include/linux/openvswitch.h
+++ b/include/linux/openvswitch.h
@@ -279,7 +279,8 @@ enum ovs_key_attr {
OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */
OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */
OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
- OVS_KEY_ATTR_TUN_ID = 63, /* be64 tunnel ID */
+ OVS_KEY_ATTR_IPV4_TUNNEL = 62, /* struct ovs_key_ipv4_tunnel */
+ OVS_KEY_ATTR_TUN_ID = 63, /* be64 tunnel ID */
__OVS_KEY_ATTR_MAX
};
@@ -361,6 +362,21 @@ struct ovs_key_nd {
__u8 nd_tll[6];
};
+/* Values for ovs_key_ipv4_tunnel->tun_flags */
+#define OVS_FLOW_TNL_F_DONT_FRAGMENT (1 << 0)
+#define OVS_FLOW_TNL_F_CSUM (1 << 1)
+#define OVS_FLOW_TNL_F_KEY (1 << 2)
+
+struct ovs_key_ipv4_tunnel {
+ __be64 tun_id;
+ __u32 tun_flags;
+ __be32 ipv4_src;
+ __be32 ipv4_dst;
+ __u8 ipv4_tos;
+ __u8 ipv4_ttl;
+ __u8 pad[2];
+};
+
/**
* enum ovs_flow_attr - attributes for %OVS_FLOW_* commands.
* @OVS_FLOW_ATTR_KEY: Nested %OVS_KEY_ATTR_* attributes specifying the flow