diff mbox series

[ovs-dev,v3,06/16] Pass chassis and encap into get_port_binding_tun

Message ID 20220217151712.2292329-7-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 success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Ihar Hrachyshka Feb. 17, 2022, 3:17 p.m. UTC
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 <ihrachys@redhat.com>
---
 controller/physical.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

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;
         }