diff options
author | Ethan Jackson <ethan@nicira.com> | 2012-04-16 12:09:49 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2012-04-17 13:36:01 -0700 |
commit | cea157688977bbbb136f9c3bfe020fe485b43d39 (patch) | |
tree | c16b1d2ebe166b403720ada4c1a70f4bdc409ddf /vswitchd | |
parent | ef8a3d14976080fc5e29ce04bea8bd88f8b631f2 (diff) |
vswitch: Use consistent representation of DSCP bits.
There are two sensible ways to represent the 6 DSCP bits of an IP
packet. One could represent them as an integer in the range 0 to
63. Or one could represent them as they would appear in the tos
field (0 to 63) << 2. Before this patch, OVS had used the former
method for the DSCP bits in the Queue Table, and the latter for the
DSCP in the Controller and Manager tables. Since the ability to
set DSCP bits in the Controller and Manager tables is so new that
it hasn't been released yet, this patch changes it to use the
existing style employed in the Queue table. Hopefully this should
make the code and configuration less confusing.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r-- | vswitchd/bridge.c | 10 | ||||
-rw-r--r-- | vswitchd/vswitch.ovsschema | 4 | ||||
-rw-r--r-- | vswitchd/vswitch.xml | 38 |
3 files changed, 28 insertions, 24 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 22a37069..74cba874 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2436,10 +2436,14 @@ bridge_ofproto_controller_from_ovsrec(const struct ovsrec_controller *c, oc->enable_async_msgs = (!c->enable_async_messages || *c->enable_async_messages); config_str = ovsrec_controller_get_other_config_value(c, "dscp", NULL); + + oc->dscp = DSCP_DEFAULT; if (config_str) { - oc->dscp = atoi(config_str); - } else { - oc->dscp = DSCP_DEFAULT; + int dscp = atoi(config_str); + + if (dscp >= 0 && dscp <= 63) { + oc->dscp = dscp; + } } } diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema index c7e1ac9e..7a51a0d6 100644 --- a/vswitchd/vswitch.ovsschema +++ b/vswitchd/vswitch.ovsschema @@ -1,6 +1,6 @@ {"name": "Open_vSwitch", - "version": "6.9.0", - "cksum": "617116616 16682", + "version": "6.9.1", + "cksum": "3226481229 16682", "tables": { "Open_vSwitch": { "columns": { diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 1128db94..ef019746 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -2698,16 +2698,16 @@ <column name="other_config" key="dscp" type='{"type": "integer"}'> - The Differentiated Service Code Point (DSCP) is specified in the IP - header. They are specified using 6 bits in the Type of Service (TOS) - field in the IP header. DSCP provides a mechanism to classify the - network traffic and provide the Quality of Service (QoS) on IP - networks. - The DSCP value passed is used when establishing the connection between - the controller and the Open vSwitch. The connection must be reset - for the new DSCP values to take effect. If no value is - specified, a default value of 192 is chosen for connection - establishment. Valid DSCP values must have their lower 2 bits set to 0. + The Differentiated Service Code Point (DSCP) is specified using 6 bits + in the Type of Service (TOS) field in the IP header. DSCP provides a + mechanism to classify the network traffic and provide Quality of + Service (QoS) on IP networks. + + The DSCP value specified here is used when establishing the connection + between the controller and the Open vSwitch. The connection must be + reset for the new DSCP values to take effect. If no value is + specified, a default value of 48 is chosen. Valid DSCP values must be + in the range 0 to 63. </column> </group> @@ -2945,16 +2945,16 @@ <column name="other_config" key="dscp" type='{"type": "integer"}'> - The Differentiated Service Code Point (DSCP) is specified in the IP - header. They are specified using 6 bits in the Type of Service (TOS) - field in the IP header. DSCP provides a mechanism to classify the - network traffic and provide the Quality of Service (QoS) on IP - networks. - The DSCP value passed when establishing the connection between - the manager and the Open vSwitch Database. The connection must be + The Differentiated Service Code Point (DSCP) is specified using 6 bits + in the Type of Service (TOS) field in the IP header. DSCP provides a + mechanism to classify the network traffic and provide Quality of + Service (QoS) on IP networks. + + The DSCP value specified here is used when establishing the connection + between the manager and the Open vSwitch. The connection must be reset for the new DSCP values to take effect. If no value is - specified, a default value of 192 is chosen for connection - establishment. Valid DSCP values must have their lower 2 bits set to 0. + specified, a default value of 48 is chosen. Valid DSCP values must be + in the range 0 to 63. </column> </group> |