aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-11-16 16:31:05 -0800
committerEthan Jackson <ethan@nicira.com>2011-11-23 12:06:54 -0800
commit8b36f51e0fdeb468058e4552858af03851b4fad3 (patch)
treef87a500e046a3ae537655a6f0066cdf135ab98ff /vswitchd
parent81b1afb19dcb4570efe1899ef99bffd2683321ed (diff)
vswitch: Implement dscp column of the Queue table.
The dscp column of the queue table instructs Open vSwitch to mark all traffic egressing the queue with the given DSCP bits in its tos field. Bug #7046.
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c23
-rw-r--r--vswitchd/vswitch.ovsschema9
-rw-r--r--vswitchd/vswitch.xml9
3 files changed, 39 insertions, 2 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 378a08cb..83e125cd 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2959,6 +2959,10 @@ iface_delete_queues(unsigned int queue_id,
static void
iface_configure_qos(struct iface *iface, const struct ovsrec_qos *qos)
{
+ struct ofpbuf queues_buf;
+
+ ofpbuf_init(&queues_buf, 0);
+
if (!qos || qos->type[0] == '\0' || qos->n_queues < 1) {
netdev_set_qos(iface->netdev, NULL, NULL);
} else {
@@ -2989,6 +2993,15 @@ iface_configure_qos(struct iface *iface, const struct ovsrec_qos *qos)
queue_zero = true;
}
+ if (queue->n_dscp == 1) {
+ struct ofproto_port_queue *port_queue;
+
+ port_queue = ofpbuf_put_uninit(&queues_buf,
+ sizeof *port_queue);
+ port_queue->queue = queue_id;
+ port_queue->dscp = queue->dscp[0];
+ }
+
shash_from_ovs_idl_map(queue->key_other_config,
queue->value_other_config,
queue->n_other_config, &details);
@@ -3004,9 +3017,19 @@ iface_configure_qos(struct iface *iface, const struct ovsrec_qos *qos)
}
}
+ if (iface->ofp_port >= 0) {
+ const struct ofproto_port_queue *port_queues = queues_buf.data;
+ size_t n_queues = queues_buf.size / sizeof *port_queues;
+
+ ofproto_port_set_queues(iface->port->bridge->ofproto, iface->ofp_port,
+ port_queues, n_queues);
+ }
+
netdev_set_policing(iface->netdev,
iface->cfg->ingress_policing_rate,
iface->cfg->ingress_policing_burst);
+
+ ofpbuf_uninit(&queues_buf);
}
static void
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 19c59227..e2f231c8 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
{"name": "Open_vSwitch",
- "version": "6.3.0",
- "cksum": "1659474737 15341",
+ "version": "6.4.0",
+ "cksum": "3757343995 15531",
"tables": {
"Open_vSwitch": {
"columns": {
@@ -256,6 +256,11 @@
"isRoot": true},
"Queue": {
"columns": {
+ "dscp": {
+ "type": {"key": {"type": "integer",
+ "minInteger": 0,
+ "maxInteger": 63},
+ "min": 0, "max": 1}},
"other_config": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}},
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 746a11aa..8eba5cbf 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1842,6 +1842,15 @@
Service (QoS) features. May be referenced by <ref column="queues"
table="QoS"/> column in <ref table="QoS"/> table.</p>
+ <column name="dscp">
+ If set, Open vSwitch will mark all traffic egressing this
+ <ref table="Queue"/> with the given DSCP bits. Traffic egressing the
+ default <ref table="Queue"/> is only marked if it was explicitly selected
+ as the <ref table="Queue"/> at the time the packet was output. If unset,
+ the DSCP bits of traffic egressing this <ref table="Queue"/> will remain
+ unchanged.
+ </column>
+
<group title="Configuration for min-rate QoS">
<p>
These key-value pairs are defined for <ref table="QoS"/> <ref