Next patches will need the same functionality while passing a
different chassis / encap configuration that is not the primary for a
port binding.

Signed-off-by: Ihar Hrachyshka <ihrac...@redhat.com>
---
 controller/physical.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/controller/physical.c b/controller/physical.c
index 3a7fbfb21..7ad142293 100644
--- a/controller/physical.c
+++ b/controller/physical.c
@@ -124,17 +124,15 @@ put_resubmit(uint8_t table_id, struct ofpbuf *ofpacts)
 }
 
 /*
- * For a port binding, get the corresponding ovn-chassis-id tunnel port
- * from the associated encap.
+ * For an encap and a chassis, get the corresponding ovn-chassis-id tunnel
+ * port.
  */
 static struct chassis_tunnel *
-get_port_binding_tun(const struct sbrec_port_binding *binding,
+get_port_binding_tun(const struct sbrec_encap *encap,
+                     const struct sbrec_chassis *chassis,
                      const struct hmap *chassis_tunnels)
 {
-    struct sbrec_encap *encap = binding->encap;
-    struct sbrec_chassis *chassis = binding->chassis;
     struct chassis_tunnel *tun = NULL;
-
     if (encap) {
         tun = chassis_tunnel_find(chassis_tunnels, chassis->name, encap->ip);
     }
@@ -295,7 +293,8 @@ put_remote_port_redirect_overlay(const struct
     if (!is_ha_remote) {
         /* Setup encapsulation */
         const struct chassis_tunnel *rem_tun =
-            get_port_binding_tun(binding, chassis_tunnels);
+            get_port_binding_tun(binding->encap, binding->chassis,
+            chassis_tunnels);
         if (!rem_tun) {
             return;
         }
-- 
2.34.1

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

Reply via email to