On Wed, Apr 02, 2014 at 06:04:27PM +0900, Simon Horman wrote:
> OpenFlow 1.1 and 1.2 specify that if a table-miss occurs then the default
> behaviour is to forward the packet the controller using a packet-in
> message. And until this patch this is the default behaviour that Open
> vSwitch uses for all OpenFlow versions.
> 
> OpenFlow1.3+ specifies that if a table-miss occurs then the default
> behaviour is simply to drop the packet. This patch implements this
> behaviour using the following logic:
> 
> If a table-miss occurs and the table-miss behaviour for the table
> has not been set using a table_mod (in which case it is no longer
> the default setting) then:
> 
> * Installing a facet in the datapath with a drop action in the
>   if there are no pre-OF1.3 controllers connected which would receive
>   an packet_in message.
> 
>   Note that this covers both the case where there are only OF1.3
>   controllers and the case where there are no controllers at all.
> 
> * Otherwise sent a packet_in message to all pre-OF1.3 controllers.
> 
>   This covers both the case where there are only pre-OF1.3
>   controllers and there are both pre-OF1.3 and OF1.3+ controllers.
> 
> Signed-off-by: Simon Horman <ho...@verge.net.au>
> 
> ---
> * v3
>   - Rebase
>     + Based on merged version of
>       "ofproto: Honour Table Mod settings for table-miss handling"
> * v2
>   - Rebase
>     * Co-exist with wire_reason()
>     + Based on v9 of
>       "ofproto: Honour Table Mod settings for table-miss handling"

Thanks, applied!

I folded in the following to suit my stylistic preference.  I added
the "= 3" so that if the previous enum values are reordered, the value
of OFPROTO_TABLE_MISS_DEFAULT still doesn't overlap with any of the
others.

diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
index 5df000c..3f3557c 100644
--- a/ofproto/ofproto.h
+++ b/ofproto/ofproto.h
@@ -437,21 +437,19 @@ int ofproto_port_set_realdev(struct ofproto *, ofp_port_t 
vlandev_ofp_port,
 /* Table configuration */
 
 enum ofproto_table_config {
+    /* Send to controller. */
     OFPROTO_TABLE_MISS_CONTROLLER = OFPTC11_TABLE_MISS_CONTROLLER,
-                                        /* Send to controller. */
+
+    /* Continue to the next table in the pipeline (OpenFlow 1.0 behavior). */
     OFPROTO_TABLE_MISS_CONTINUE   = OFPTC11_TABLE_MISS_CONTINUE,
-                                        /* Continue to the next table in the
-                                           pipeline (OpenFlow 1.0 behavior). */
+
+    /* Drop the packet. */
     OFPROTO_TABLE_MISS_DROP       = OFPTC11_TABLE_MISS_DROP,
-                                        /* Drop the packet. */
-
-    OFPROTO_TABLE_MISS_DEFAULT,         /* The default miss behaviour for
-                                         * the OpenFlow version of the
-                                         * controller a packet_in message
-                                         * would be sent to..
-                                         * For pre-OF1.3 controllers,
-                                         * send packet_in to controller.
-                                         * For OF1.3+ controllers, drop. */
+
+    /* The default miss behaviour for the OpenFlow version of the controller a
+     * packet_in message would be sent to..  For pre-OF1.3 controllers, send
+     * packet_in to controller.  For OF1.3+ controllers, drop. */
+    OFPROTO_TABLE_MISS_DEFAULT    = 3,
 };
 
 enum ofproto_table_config ofproto_table_get_config(const struct ofproto *,
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to