mirror of
https://github.com/openvswitch/ovs
synced 2025-10-23 14:57:06 +00:00
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>
This commit is contained in:
committed by
Pravin B Shelar
parent
4206b80f64
commit
356af50bc2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user