[ovs-dev] [RFC ovn 3/3] northd: interoduce logical flow for localnet egress shaping

Lorenzo Bianconi lorenzo.bianconi at redhat.com
Wed Sep 11 17:19:48 UTC 2019


Add set_queue() action for qos capable localnet port in
S_SWITCH_OUT_PORT_SEC_L2 stage of logical switch pipeline

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
---
 northd/ovn-northd.8.xml |  7 ++++++-
 northd/ovn-northd.c     | 12 +++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml
index b34ef687a..d28f8965c 100644
--- a/northd/ovn-northd.8.xml
+++ b/northd/ovn-northd.8.xml
@@ -1150,10 +1150,15 @@ output;
       <code>eth.dst</code> are always accepted instead of being subject to the
       port security rules; this is implemented through a priority-100 flow that
       matches on <code>eth.mcast</code> with action <code>output;</code>.
-      Finally, to ensure that even broadcast and multicast packets are not
+      Moreover, to ensure that even broadcast and multicast packets are not
       delivered to disabled logical ports, a priority-150 flow for each
       disabled logical <code>outport</code> overrides the priority-100 flow
       with a <code>drop;</code> action.
+      Finally if egress qos has been enabled on a localnet port, the outgoing
+      queue id is set through <code>set_queue</code> action. Please remember to
+      mark the corresponding physical interface with
+      <code>ovn-egress-iface</code> set to true in <ref column="external_ids"
+      table="Interface" db="Open_vSwitch"/>
     </p>
 
     <h2>Logical Router Datapaths</h2>
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 889eeb795..5bae035b3 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -5681,10 +5681,20 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
         ds_clear(&match);
         ds_put_format(&match, "outport == %s", op->json_key);
         if (lsp_is_enabled(op->nbsp)) {
+            ds_clear(&actions);
+
+            if (!strcmp(op->nbsp->type, "localnet")) {
+                const char *queue_id = smap_get(&op->sb->options,
+                                                "qdisc_queue_id");
+                if (queue_id) {
+                    ds_put_format(&actions, "set_queue(%s); ", queue_id);
+                }
+            }
+            ds_put_cstr(&actions, "output;");
             build_port_security_l2("eth.dst", op->ps_addrs, op->n_ps_addrs,
                                    &match);
             ovn_lflow_add(lflows, op->od, S_SWITCH_OUT_PORT_SEC_L2, 50,
-                          ds_cstr(&match), "output;");
+                          ds_cstr(&match), ds_cstr(&actions));
         } else {
             ovn_lflow_add(lflows, op->od, S_SWITCH_OUT_PORT_SEC_L2, 150,
                           ds_cstr(&match), "drop;");
-- 
2.21.0



More information about the dev mailing list