diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-12-10 10:42:42 -0800 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-12-10 11:14:13 -0800 |
| commit | b9298d3f825703063c9538aa37407da43e1e4781 (patch) | |
| tree | b17463dd7194e5fd41cf79ce1115c93861450bd0 /include/openvswitch | |
| parent | ff9d38264c74e2e807ba0fd759e44116d1203670 (diff) | |
| download | openvswitch-b9298d3f825703063c9538aa37407da43e1e4781.tar.gz | |
Expand tunnel IDs from 32 to 64 bits.
We have a need to identify tunnels with keys longer than 32 bits. This
commit adds basic datapath and OpenFlow support for such keys. It doesn't
actually add any tunnel protocols that support 64-bit keys, so this is not
very useful yet.
The 'arg' member of struct odp_msg had to be expanded to 64-bits also,
because it sometimes contains a tunnel ID. This member also contains the
argument passed to ODPAT_CONTROLLER, so I expanded that action's argument
to 64 bits also so that it can use the full width of the expanded 'arg'.
Userspace doesn't take advantage of the new space though (it was only
using 16 bits anyhow).
This commit has been tested only to the extent that it doesn't disrupt
basic Open vSwitch operation. I have not tested it with tunnel traffic.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Feature #3976.
Diffstat (limited to 'include/openvswitch')
| -rw-r--r-- | include/openvswitch/datapath-protocol.h | 12 | ||||
| -rw-r--r-- | include/openvswitch/tunnel.h | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h index 731a84935..ad68e9e11 100644 --- a/include/openvswitch/datapath-protocol.h +++ b/include/openvswitch/datapath-protocol.h @@ -63,6 +63,8 @@ #ifndef __aligned_u64 #define __aligned_u64 __u64 __attribute__((aligned(8))) +#define __aligned_be64 __be64 __attribute__((aligned(8))) +#define __aligned_le64 __le64 __attribute__((aligned(8))) #endif #include <linux/if_link.h> @@ -141,10 +143,9 @@ struct odp_stats { /** * struct odp_msg - format of messages read from datapath fd. - * @type: One of the %_ODPL_* constants. * @length: Total length of message, including this header. + * @type: One of the %_ODPL_* constants. * @port: Port that received the packet embedded in this message. - * @reserved: Not currently used. Should be set to 0. * @arg: Argument value whose meaning depends on @type. * * For @type == %_ODPL_MISS_NR, the header is followed by packet data. The @@ -161,11 +162,10 @@ struct odp_stats { * data. */ struct odp_msg { - uint32_t type; uint32_t length; + uint16_t type; uint16_t port; - uint16_t reserved; - uint32_t arg; + __aligned_u64 arg; }; /** @@ -219,7 +219,7 @@ struct odp_flow_stats { #define ODP_TCI_PRESENT 0x1000 /* CFI bit */ struct odp_flow_key { - ovs_be32 tun_id; /* Encapsulating tunnel ID. */ + ovs_be64 tun_id; /* Encapsulating tunnel ID. */ ovs_be32 nw_src; /* IP source address. */ ovs_be32 nw_dst; /* IP destination address. */ uint16_t in_port; /* Input switch port. */ diff --git a/include/openvswitch/tunnel.h b/include/openvswitch/tunnel.h index e7d3fce71..d545e40e3 100644 --- a/include/openvswitch/tunnel.h +++ b/include/openvswitch/tunnel.h @@ -53,13 +53,13 @@ /* This goes in the "config" member of struct odp_port for tunnel vports. */ struct tnl_port_config { - __u32 flags; - __be32 saddr; - __be32 daddr; - __be32 in_key; - __be32 out_key; - __u8 tos; - __u8 ttl; + __aligned_be64 in_key; + __aligned_be64 out_key; + __u32 flags; + __be32 saddr; + __be32 daddr; + __u8 tos; + __u8 ttl; }; #endif /* openvswitch/tunnel.h */ |
