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

bschanmu at redhat.com bschanmu at redhat.com
Wed Jul 20 14:32:04 UTC 2016


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

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

diff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c
index 42c9055..140377f 100644
--- a/ovn/controller/lflow.c
+++ b/ovn/controller/lflow.c
@@ -118,7 +118,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 66e9c8a..a2903e4 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -1929,6 +1929,10 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
                                &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(&actions, "set_queue(%s); ", queue_id);
         }
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index ebcd118..4c8ea90 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -235,6 +235,12 @@
           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 63 (inclusive).
+        </column>
       </group>
     </group>
 
diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml
index a454f5f..9549254 100644
--- a/ovn/ovn-sb.xml
+++ b/ovn/ovn-sb.xml
@@ -1734,6 +1734,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 63 (inclusive).
+      </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.5




More information about the dev mailing list