diff mbox series

[ovs-dev,v3,03/16] Introduce chassis_is_vtep

Message ID 20220217151712.2292329-4-ihrachys@redhat.com
State Changes Requested
Headers show
Series Support additional-chassis for ports | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Ihar Hrachyshka Feb. 17, 2022, 3:16 p.m. UTC
This tiny helper will be reused later.

Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
---
 controller/physical.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/controller/physical.c b/controller/physical.c
index 6bfa2304d..3a7fbfb21 100644
--- a/controller/physical.c
+++ b/controller/physical.c
@@ -1408,6 +1408,12 @@  fanout_to_chassis(enum mf_field_id mff_ovn_geneve,
     }
 }
 
+static bool
+chassis_is_vtep(const struct sbrec_chassis *chassis)
+{
+    return smap_get_bool(&chassis->other_config, "is-vtep", false);
+}
+
 static void
 consider_mc_group(struct ovsdb_idl_index *sbrec_port_binding_by_name,
                   enum mf_field_id mff_ovn_geneve,
@@ -1519,8 +1525,7 @@  consider_mc_group(struct ovsdb_idl_index *sbrec_port_binding_by_name,
             /* Add remote chassis only when localnet port not exist,
              * otherwise multicast will reach remote ports through localnet
              * port. */
-            if (smap_get_bool(&port->chassis->other_config,
-                              "is-vtep", false)) {
+            if (chassis_is_vtep(port->chassis)) {
                 sset_add(&vtep_chassis, port->chassis->name);
             } else {
                 sset_add(&remote_chassis, port->chassis->name);