According to the OvS documentation, setting interface type to an empty
string is equivalent of configuring the type column to system.
Fix OvS port selection in get_qos_egress_port_interface() taking into
account the CMS can configure the interface setting type to system.

Reported-at: https://issues.redhat.com/browse/FDP-1472
Signed-off-by: Lorenzo Bianconi <lorenzo.bianc...@redhat.com>
---
 controller/binding.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/controller/binding.c b/controller/binding.c
index b2ecd58c1..91cd46e7e 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -191,6 +191,20 @@ destroy_qos_map(struct hmap *qos_map)
     hmap_destroy(qos_map);
 }
 
+static bool is_qos_iface(const struct ovsrec_interface *iface)
+{
+    if (smap_get_bool(&iface->external_ids,
+                      "ovn-egress-iface", false)) {
+        return true;
+    }
+
+    if (!strcmp(iface->type, "") || !strcmp(iface->type, "system")) {
+        return true;
+    }
+
+    return false;
+}
+
 static const struct ovsrec_interface *
 get_qos_egress_port_interface(struct shash *bridge_mappings,
                               const struct ovsrec_port **pport,
@@ -211,9 +225,7 @@ get_qos_egress_port_interface(struct shash *bridge_mappings,
                 continue;
             }
 
-            if (smap_get_bool(&iface->external_ids,
-                              "ovn-egress-iface", false) ||
-                !strcmp(iface->type, "")) {
+            if (is_qos_iface(iface)) {
                 *pport = port;
                 return iface;
             }
-- 
2.49.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to