summaryrefslogtreecommitdiff
path: root/include/openflow
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2016-01-20 08:05:20 -0800
committerBen Pfaff <blp@ovn.org>2016-01-20 08:05:20 -0800
commitd2e5fa1f91a1465b608adf513509f27c853f1250 (patch)
tree6425f420cb1912912b25fefc31a067ee44c451da /include/openflow
parent3e461c2c0e5b807fe234b4723969014baf2ce0b8 (diff)
downloadopenvswitch-d2e5fa1f91a1465b608adf513509f27c853f1250.tar.gz
openflow: Rename OF0.1-1.3 queue property constants.
At first glance, OF1.4 queue properties look a lot like those for OF1.0 to OF1.3, but in fact their different padding makes them incompatible. In addition, OF1.4 switches from using regular OpenFlow messages to request queue properties, to using multipart messages. Thus, we really need to use separate code to deal with OF1.4 queues. OF1.0, OF1.1, and OF1.2 all have slightly different queue config reply messages, but only OF1.0 and OF1.2 had tests, so this adds tests. (There is no test for OF1.3 because it's the same as OF1.2.) Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'include/openflow')
-rw-r--r--include/openflow/openflow-1.0.h37
-rw-r--r--include/openflow/openflow-common.h23
2 files changed, 36 insertions, 24 deletions
diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h
index 54b15f258..db629f77c 100644
--- a/include/openflow/openflow-1.0.h
+++ b/include/openflow/openflow-1.0.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -137,6 +137,41 @@ struct ofp10_packet_queue {
};
OFP_ASSERT(sizeof(struct ofp10_packet_queue) == 8);
+/* Queue properties for OF1.0 to OF1.3.
+ *
+ * OF1.4+ use the same numbers but rename them and change the property formats
+ * in incompatible ways, so there's not much benefit to sharing the names. */
+enum ofp10_queue_properties {
+ /* Introduced in OF1.0. */
+ OFPQT10_MIN_RATE = 1, /* Minimum datarate guaranteed. */
+
+ /* Introduced in OF1.1. */
+ OFPQT11_MAX_RATE = 2, /* Maximum guaranteed rate. */
+ OFPQT11_EXPERIMENTER = 0xffff, /* Experimenter defined property. */
+};
+
+/* Description for a queue in OpenFlow 1.0 to 1.3.
+ *
+ * OF1.4+ also use a TLV format but an incompatible one. */
+struct ofp10_queue_prop_header {
+ ovs_be16 property; /* One of OFPQT*. */
+ ovs_be16 len; /* Length of property, including this header. */
+ uint8_t pad[4]; /* 64-bit alignemnt. */
+};
+OFP_ASSERT(sizeof(struct ofp10_queue_prop_header) == 8);
+
+/* Min-Rate and Max-Rate queue property description (OFPQT10_MIN and
+ * OFPQT11_MAX).
+ *
+ * OF1.4+ use similar TLVs but they are incompatible due to different padding.
+ */
+struct ofp10_queue_prop_rate {
+ struct ofp10_queue_prop_header prop_header;
+ ovs_be16 rate; /* In 1/10 of a percent; >1000 -> disabled. */
+ uint8_t pad[6]; /* 64-bit alignment */
+};
+OFP_ASSERT(sizeof(struct ofp10_queue_prop_rate) == 16);
+
/* Query for port queue configuration. */
struct ofp10_queue_get_config_request {
ovs_be16 port; /* Port to be queried. Should refer
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h
index 81f9120cc..f152718f5 100644
--- a/include/openflow/openflow-common.h
+++ b/include/openflow/openflow-common.h
@@ -209,29 +209,6 @@ enum ofp_port_features {
OFPPF_10GB_FD = 1 << 6, /* 10 Gb full-duplex rate support. */
};
-enum ofp_queue_properties {
- OFPQT_MIN_RATE = 1, /* Minimum datarate guaranteed. */
- OFPQT_MAX_RATE = 2, /* Maximum guaranteed rate. */
- OFPQT_EXPERIMENTER = 0xffff, /* Experimenter defined property. */
-};
-
-/* Common description for a queue. */
-struct ofp_queue_prop_header {
- ovs_be16 property; /* One of OFPQT_. */
- ovs_be16 len; /* Length of property, including this header. */
- uint8_t pad[4]; /* 64-bit alignemnt. */
-};
-OFP_ASSERT(sizeof(struct ofp_queue_prop_header) == 8);
-
-/* Min-Rate and Max-Rate queue property description (OFPQT_MIN and
- * OFPQT_MAX). */
-struct ofp_queue_prop_rate {
- struct ofp_queue_prop_header prop_header;
- ovs_be16 rate; /* In 1/10 of a percent; >1000 -> disabled. */
- uint8_t pad[6]; /* 64-bit alignment */
-};
-OFP_ASSERT(sizeof(struct ofp_queue_prop_rate) == 16);
-
/* Switch features. */
struct ofp_switch_features {
ovs_be64 datapath_id; /* Datapath unique ID. The lower 48-bits are for