summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-12-10 10:42:42 -0800
committerBen Pfaff <blp@nicira.com>2010-12-10 11:14:13 -0800
commitb9298d3f825703063c9538aa37407da43e1e4781 (patch)
treeb17463dd7194e5fd41cf79ce1115c93861450bd0 /include
parentff9d38264c74e2e807ba0fd759e44116d1203670 (diff)
downloadopenvswitch-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')
-rw-r--r--include/openflow/nicira-ext.h19
-rw-r--r--include/openvswitch/datapath-protocol.h12
-rw-r--r--include/openvswitch/tunnel.h14
3 files changed, 30 insertions, 15 deletions
diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h
index de3c2e5ef..135f793ed 100644
--- a/include/openflow/nicira-ext.h
+++ b/include/openflow/nicira-ext.h
@@ -228,7 +228,8 @@ enum nx_action_subtype {
NXAST_POP_QUEUE, /* struct nx_action_pop_queue */
NXAST_REG_MOVE, /* struct nx_action_reg_move */
NXAST_REG_LOAD, /* struct nx_action_reg_load */
- NXAST_NOTE /* struct nx_action_note */
+ NXAST_NOTE, /* struct nx_action_note */
+ NXAST_SET_TUNNEL64, /* struct nx_action_set_tunnel64 */
};
/* Header for Nicira-defined actions. */
@@ -279,7 +280,8 @@ OFP_ASSERT(sizeof(struct nx_action_resubmit) == 16);
/* Action structure for NXAST_SET_TUNNEL.
*
- * Sets the encapsulating tunnel ID. */
+ * Sets the encapsulating tunnel ID to a 32-bit value. The most-significant 32
+ * bits of the tunnel ID are set to 0. */
struct nx_action_set_tunnel {
uint16_t type; /* OFPAT_VENDOR. */
uint16_t len; /* Length is 16. */
@@ -290,6 +292,19 @@ struct nx_action_set_tunnel {
};
OFP_ASSERT(sizeof(struct nx_action_set_tunnel) == 16);
+/* Action structure for NXAST_SET_TUNNEL64.
+ *
+ * Sets the encapsulating tunnel ID to a 64-bit value. */
+struct nx_action_set_tunnel64 {
+ ovs_be16 type; /* OFPAT_VENDOR. */
+ ovs_be16 len; /* Length is 16. */
+ ovs_be32 vendor; /* NX_VENDOR_ID. */
+ ovs_be16 subtype; /* NXAST_SET_TUNNEL64. */
+ uint8_t pad[6];
+ ovs_be64 tun_id; /* Tunnel ID. */
+};
+OFP_ASSERT(sizeof(struct nx_action_set_tunnel64) == 24);
+
/* Action structure for NXAST_DROP_SPOOFED_ARP.
*
* Stops processing further actions, if the packet being processed is an
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 */