[ovs-dev] [PATCH v2 2/2] DSCP marking on packets egressing VIF interface

bschanmu at redhat.com bschanmu at redhat.com
Wed May 25 10:05:45 UTC 2016


ovn-northd sets 'ip.dscp' to the DSCP value

Signed-off-by: Babu Shanmugam <bschanmu at redhat.com>
---
 ovn/controller/lflow.c  | 2 +-
 ovn/northd/ovn-northd.c | 4 ++++
 ovn/ovn-nb.xml          | 5 +++++
 ovn/ovn-sb.xml          | 5 +++++
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c
index 96b7c66..360de95 100644
--- a/ovn/controller/lflow.c
+++ b/ovn/controller/lflow.c
@@ -97,7 +97,7 @@ lflow_init(void)
     expr_symtab_add_predicate(&symtab, "ip6", "eth.type == 0x86dd");
     expr_symtab_add_predicate(&symtab, "ip", "ip4 || ip6");
     expr_symtab_add_field(&symtab, "ip.proto", MFF_IP_PROTO, "ip", true);
-    expr_symtab_add_field(&symtab, "ip.dscp", MFF_IP_DSCP, "ip", false);
+    expr_symtab_add_field(&symtab, "ip.dscp", MFF_IP_DSCP_SHIFTED, "ip", false);
     expr_symtab_add_field(&symtab, "ip.ecn", MFF_IP_ECN, "ip", false);
     expr_symtab_add_field(&symtab, "ip.ttl", MFF_IP_TTL, "ip", false);
 
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 81c1519..a5cf2c0 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -1594,6 +1594,10 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
             "eth.src", op->nbs->port_security, op->nbs->n_port_security,
             &match);
         const char *queue_id = smap_get(&op->sb->options, "qdisc_queue_id");
+        const char *dscp = smap_get(&op->sb->options, "qos_dscp");
+        if (dscp) {
+            ds_put_format(&action, "ip.dscp = %s;", dscp);
+        }
         if (queue_id) {
             ds_put_format(&action, "set_queue(%s);", queue_id);
         }
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index 45306dc..0ce2147 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -211,6 +211,11 @@
           If set, indicates the maximum burst size for data sent from this
           interface, in bits.
         </column>
+
+        <column name="options" key="qos_dscp">
+          If set, indicates the DSCP code to be marked on the packets egressing
+          the VIF interface. Value should be in the range of 0 to 64.
+        </column>
       </group>
     </group>
 
diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml
index eb6f745..cb2a8d8 100644
--- a/ovn/ovn-sb.xml
+++ b/ovn/ovn-sb.xml
@@ -1417,6 +1417,11 @@ tcp.flags = RST;
         interface, in bits.
       </column>
 
+      <column name="options" key="qos_dscp">
+        If set, indicates the DSCP code to be marked on the packets egressing
+        the VIF interface. Value should be in the range of 0 to 64.
+      </column>
+
       <column name="options" key="qdisc_queue_id">
         Indicates the queue number on the physical device. This is same as the
         queue_id used in OpenFlow in struct ofp_action_enqueue. Value should
-- 
2.5.0




More information about the dev mailing list