vswitchd: Always configure a default queue for QoS.
authorBen Pfaff <blp@nicira.com>
Fri, 17 Feb 2012 00:33:14 +0000 (16:33 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 17 Feb 2012 00:33:14 +0000 (16:33 -0800)
When an interface has QoS configured but no default queue (queue 0), OVS
has until now installed that QoS configuration literally, which causes all
packets destined for this default queue to be dropped.  This behavior is
usually both unexpected and undesirable.

This commit changes behavior so that, when no default queue is configured,
OVS uses a default "empty" configuration for the default queue.  This
behavior should be more acceptable when QoS is slightly misconfigured.

I tested that, without this patch, configuring only queue 1 causes "tc
class show" to show only queue 1 (handle 1:2) for linux-htb and linux-hfsc,
and that with this patch it shows configurations for both queue 0 (handle
1:1) and queue 1.

Bug #5583.
Feature #7413.
Signed-off-by: Ben Pfaff <blp@nicira.com>
NEWS
vswitchd/bridge.c
vswitchd/vswitch.xml

diff --git a/NEWS b/NEWS
index b176130..c16649e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,9 @@ post-v1.5.0
         - Added "fin_timeout" support to "learn" action.
     - The default MAC learning timeout has been increased from 60 seconds
       to 300 seconds.  The MAC learning timeout is now configurable.
+    - When QoS settings for an interface do not configure a default queue
+      (queue 0), Open vSwitch now uses a default configuration for that
+      queue, instead of dropping all packets as in previous versions.
     - Logging to console and file will have UTC timestamp as a default for all
       the daemons. An example of the default format is 2012-01-27T16:35:17Z.
       ovs-appctl can be used to change the default format as before.
index f6cf119..e857077 100644 (file)
@@ -3198,9 +3198,12 @@ iface_configure_qos(struct iface *iface, const struct ovsrec_qos *qos)
         if (!queue_zero) {
             static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
             VLOG_WARN_RL(&rl, "interface %s: QoS configured without a default "
-                         "queue (queue 0).  Packets not directed to a "
-                         "correctly configured queue may be dropped.",
+                         "queue (queue 0).  Using default configuration.",
                          iface->name);
+
+            shash_init(&details);
+            netdev_set_queue(iface->netdev, 0, &details);
+            shash_destroy(&details);
         }
     }
 
index 5941d22..cd50f55 100644 (file)
       supported range of queue numbers depend on <ref column="type"/>.  The
       queue numbers are the same as the <code>queue_id</code> used in
       OpenFlow in <code>struct ofp_action_enqueue</code> and other
-      structures.  Queue 0 is used by OpenFlow output actions that do not
-      specify a specific queue.</p>
+      structures.</p>
+
+      <p>
+        Queue 0 is the ``default queue.''  It is used by OpenFlow output
+        actions when no specific queue has been set.  Ordinarily <ref
+        column="queues"/> should include a configuration for queue 0.  When no
+        configuration for queue 0 is present, a default configuration is used.
+        (Before version 1.6, Open vSwitch would leave queue 0 unconfigured in
+        this case.  With some queuing disciplines, this dropped all packets
+        destined for the default queue.)
+      </p>
     </column>
 
     <group title="Configuration for linux-htb and linux-hfsc">