[ovs-dev] [PATCH] ofproto: Add OF1.4 elements to enum ofp_table_config
Ben Pfaff
blp at nicira.com
Mon Dec 2 22:34:12 UTC 2013
From: Simon Horman <horms at verge.net.au>
Add elements to enum ofp_table_config for table mod bits
defined in OpenFlow1.4.
Also tidy up the indentation of existing elements.
Signed-off-by: Simon Horman <horms at verge.net.au>
Co-authored-by: Ben Pfaff <blp at nicira.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>
---
include/openflow/openflow-1.1.h | 12 ------------
include/openflow/openflow-common.h | 16 +++++++++++-----
ofproto/ofproto-dpif-xlate.c | 8 ++++----
3 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/include/openflow/openflow-1.1.h b/include/openflow/openflow-1.1.h
index 4ee9c5c..9015109 100644
--- a/include/openflow/openflow-1.1.h
+++ b/include/openflow/openflow-1.1.h
@@ -443,18 +443,6 @@ struct ofp11_table_mod {
};
OFP_ASSERT(sizeof(struct ofp11_table_mod) == 8);
-/* Flags to indicate behavior of the flow table for unmatched packets.
- These flags are used in ofp_table_stats messages to describe the current
- configuration and in ofp_table_mod messages to configure table behavior. */
-enum ofp11_table_config {
- OFPTC11_TABLE_MISS_CONTROLLER = 0 << 0, /* Send to controller. */
- OFPTC11_TABLE_MISS_CONTINUE = 1 << 0, /* Continue to the next table in the
- pipeline (OpenFlow 1.0
- behavior). */
- OFPTC11_TABLE_MISS_DROP = 2 << 0, /* Drop the packet. */
-#define OFPTC11_TABLE_MISS_MASK (3 << 0)
-};
-
/* Flow setup and teardown (controller -> datapath). */
struct ofp11_flow_mod {
ovs_be64 cookie; /* Opaque controller-issued identifier. */
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h
index ef9409f..bf16d59 100644
--- a/include/openflow/openflow-common.h
+++ b/include/openflow/openflow-common.h
@@ -476,11 +476,17 @@ enum ofp_table {
};
enum ofp_table_config {
- OFPTC_TABLE_MISS_CONTROLLER = 0 << 0, /* Send to controller. */
- OFPTC_TABLE_MISS_CONTINUE = 1 << 0, /* Continue to the next table in the
- pipeline (OpenFlow 1.0 behavior). */
- OFPTC_TABLE_MISS_DROP = 2 << 0, /* Drop the packet. */
- OFPTC_TABLE_MISS_MASK = 3 << 0
+ /* OpenFlow 1.1 and 1.2 defined this field as shown.
+ * OpenFlow 1.3 and later mark this field as deprecated, but have not
+ * reused it for any new purpose. */
+ OFPTC11_TABLE_MISS_CONTROLLER = 0 << 0, /* Send to controller. */
+ OFPTC11_TABLE_MISS_CONTINUE = 1 << 0, /* Go to next table, like OF1.0. */
+ OFPTC11_TABLE_MISS_DROP = 2 << 0, /* Drop the packet. */
+ OFPTC11_TABLE_MISS_MASK = 3 << 0,
+
+ /* OpenFlow 1.4. */
+ OFPTC14_EVICTION = 1 << 2, /* Allow table to evict flows. */
+ OFPTC14_VACANCY_EVENTS = 1 << 3, /* Enable vacancy events. */
};
#endif /* openflow/openflow-common.h */
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index a331c0b..24bade1 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -1868,10 +1868,10 @@ xlate_table_action(struct xlate_ctx *ctx,
/* XXX
* check if table configuration flags
- * OFPTC_TABLE_MISS_CONTROLLER, default.
- * OFPTC_TABLE_MISS_CONTINUE,
- * OFPTC_TABLE_MISS_DROP
- * When OF1.0, OFPTC_TABLE_MISS_CONTINUE is used. What to do? */
+ * OFPTC11_TABLE_MISS_CONTROLLER, default.
+ * OFPTC11_TABLE_MISS_CONTINUE,
+ * OFPTC11_TABLE_MISS_DROP
+ * When OF1.0, OFPTC11_TABLE_MISS_CONTINUE is used. What to do? */
xport = get_ofp_port(ctx->xbridge, ctx->xin->flow.in_port.ofp_port);
choose_miss_rule(xport ? xport->config : 0,
ctx->xbridge->miss_rule,
--
1.7.10.4
More information about the dev
mailing list