diff mbox series

[ovs-dev,v3,09/16] Use get_port_binding_tun instead of chassis_tunnel_find

Message ID 20220217151712.2292329-10-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:17 p.m. UTC
Right now consider_port_binding first extracts *a* tunnel for a
chassis, then later in put_remote_port_redirect_overlay it fetches
*the* proper tunnel before configuring encapsulation.

Instead of doing it in two steps, just extract the proper tunnel info
earlier.

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

Patch

diff --git a/controller/physical.c b/controller/physical.c
index dea7dc1c2..d28772ed8 100644
--- a/controller/physical.c
+++ b/controller/physical.c
@@ -301,17 +301,14 @@  put_remote_port_redirect_overlay(const struct
 {
     if (!is_ha_remote) {
         /* Setup encapsulation */
-        const struct chassis_tunnel *rem_tun =
-            get_port_binding_tun(binding->encap, binding->chassis,
-            chassis_tunnels);
-        if (!rem_tun) {
+        if (!tun) {
             return;
         }
         put_encapsulation(mff_ovn_geneve, tun, binding->datapath, port_key,
                           !strcmp(binding->type, "vtep"),
                           ofpacts_p);
         /* Output to tunnel. */
-        ofpact_put_OUTPUT(ofpacts_p)->port = rem_tun->ofport;
+        ofpact_put_OUTPUT(ofpacts_p)->port = tun->ofport;
     } else {
         /* Make sure all tunnel endpoints use the same encapsulation,
          * and set it up */
@@ -1079,8 +1076,8 @@  consider_port_binding(struct ovsdb_idl_index *sbrec_port_binding_by_name,
                 if (!binding->chassis) {
                     goto out;
                 }
-                tun = chassis_tunnel_find(chassis_tunnels,
-                                          binding->chassis->name, NULL);
+                tun = get_port_binding_tun(binding->encap, binding->chassis,
+                                           chassis_tunnels);
                 if (!tun) {
                     goto out;
                 }