diff mbox series

[ovs-dev,RFC,3/3] controller: get rid of egress_ifaces

Message ID 661eec45bb43bffe7992cfc77bdbb36d1c233ac3.1679083119.git.lorenzo.bianconi@redhat.com
State Changes Requested
Headers show
Series rework OVN QoS implementation | expand

Commit Message

Lorenzo Bianconi March 17, 2023, 8 p.m. UTC
Remove sset egress_ifaces processing since it is no longer used.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 controller/binding.c        | 55 -------------------------------------
 controller/binding.h        |  1 -
 controller/ovn-controller.c | 10 ++-----
 tests/ovn-performance.at    |  5 ----
 4 files changed, 2 insertions(+), 69 deletions(-)
diff mbox series

Patch

diff --git a/controller/binding.c b/controller/binding.c
index a58183479..a063180ac 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -358,39 +358,6 @@  sbrec_get_port_encap(const struct sbrec_chassis *chassis_rec,
     return best_encap;
 }
 
-static void
-add_localnet_egress_interface_mappings(
-        const struct sbrec_port_binding *port_binding,
-        struct shash *bridge_mappings, struct sset *egress_ifaces)
-{
-    const char *network = smap_get(&port_binding->options, "network_name");
-    if (!network) {
-        return;
-    }
-
-    struct ovsrec_bridge *br_ln = shash_find_data(bridge_mappings, network);
-    if (!br_ln) {
-        return;
-    }
-
-    /* Add egress-ifaces from the connected bridge */
-    for (size_t i = 0; i < br_ln->n_ports; i++) {
-        const struct ovsrec_port *port_rec = br_ln->ports[i];
-
-        for (size_t j = 0; j < port_rec->n_interfaces; j++) {
-            const struct ovsrec_interface *iface_rec;
-
-            iface_rec = port_rec->interfaces[j];
-            bool is_egress_iface = smap_get_bool(&iface_rec->external_ids,
-                                                 "ovn-egress-iface", false);
-            if (!is_egress_iface) {
-                continue;
-            }
-            sset_add(egress_ifaces, iface_rec->name);
-        }
-    }
-}
-
 static bool
 is_network_plugged(const struct sbrec_port_binding *binding_rec,
                    struct shash *bridge_mappings)
@@ -431,7 +398,6 @@  update_ld_multichassis_ports(const struct sbrec_port_binding *binding_rec,
 static void
 update_ld_localnet_port(const struct sbrec_port_binding *binding_rec,
                         struct shash *bridge_mappings,
-                        struct sset *egress_ifaces,
                         struct hmap *local_datapaths)
 {
     /* Ignore localnet ports for unplugged networks. */
@@ -439,9 +405,6 @@  update_ld_localnet_port(const struct sbrec_port_binding *binding_rec,
         return;
     }
 
-    add_localnet_egress_interface_mappings(binding_rec,
-            bridge_mappings, egress_ifaces);
-
     struct local_datapath *ld
         = get_local_datapath(local_datapaths,
                              binding_rec->datapath->tunnel_key);
@@ -1846,15 +1809,6 @@  build_local_bindings(struct binding_ctx_in *b_ctx_in,
                 smap_replace(b_ctx_out->local_iface_ids, iface_rec->name,
                              iface_id);
             }
-
-            /* Check if this is a tunnel interface. */
-            if (smap_get(&iface_rec->options, "remote_ip")) {
-                const char *tunnel_iface
-                    = smap_get(&iface_rec->status, "tunnel_egress_iface");
-                if (tunnel_iface) {
-                    sset_add(b_ctx_out->egress_ifaces, tunnel_iface);
-                }
-            }
         }
     }
 }
@@ -1979,7 +1933,6 @@  binding_run(struct binding_ctx_in *b_ctx_in, struct binding_ctx_out *b_ctx_out)
     struct lport *lnet_lport;
     LIST_FOR_EACH_POP (lnet_lport, list_node, &localnet_lports) {
         update_ld_localnet_port(lnet_lport->pb, &bridge_mappings,
-                                b_ctx_out->egress_ifaces,
                                 b_ctx_out->local_datapaths);
         free(lnet_lport);
     }
@@ -2394,12 +2347,6 @@  binding_handle_ovs_interface_changes(struct binding_ctx_in *b_ctx_in,
             break;
         }
 
-        if (smap_get(&iface_rec->external_ids, "ovn-egress-iface") ||
-            sset_contains(b_ctx_out->egress_ifaces, iface_rec->name)) {
-            handled = false;
-            break;
-        }
-
         const char *iface_id = smap_get(&iface_rec->external_ids, "iface-id");
         const char *old_iface_id = smap_get(b_ctx_out->local_iface_ids,
                                             iface_rec->name);
@@ -2786,7 +2733,6 @@  handle_updated_port(struct binding_ctx_in *b_ctx_in,
                                 b_ctx_in->bridge_table,
                                 &bridge_mappings);
         update_ld_localnet_port(pb, &bridge_mappings,
-                                b_ctx_out->egress_ifaces,
                                 b_ctx_out->local_datapaths);
         shash_destroy(&bridge_mappings);
         break;
@@ -2980,7 +2926,6 @@  delete_done:
                 enum en_lport_type lport_type = get_lport_type(pb);
                 if (lport_type == LP_LOCALNET) {
                     update_ld_localnet_port(pb, &bridge_mappings,
-                                            b_ctx_out->egress_ifaces,
                                             b_ctx_out->local_datapaths);
                 } else if (lport_type == LP_EXTERNAL) {
                     update_ld_external_ports(pb, b_ctx_out->local_datapaths);
diff --git a/controller/binding.h b/controller/binding.h
index 6c3a98b02..86b8bdc79 100644
--- a/controller/binding.h
+++ b/controller/binding.h
@@ -91,7 +91,6 @@  struct binding_ctx_out {
      */
     bool non_vif_ports_changed;
 
-    struct sset *egress_ifaces;
     /* smap of OVS interface name as key and
      * OVS interface external_ids:iface-id as value. */
     struct smap *local_iface_ids;
diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 4e2301365..31bba00e4 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -1349,7 +1349,6 @@  struct ed_type_runtime_data {
     struct sset active_tunnels;
 
     /* runtime data engine private data. */
-    struct sset egress_ifaces;
     struct smap local_iface_ids;
 
     /* Tracked data. See below for more details and comments. */
@@ -1407,8 +1406,8 @@  struct ed_type_runtime_data {
  * | lbinding_data   | the @tracked_dp_bindings indirectly and hence it  |
  * | local_lport_ids  | is not tracked explicitly.                       |
  *  ---------------------------------------------------------------------
- * | local_iface_ids  | This is used internally within the runtime data  |
- * | egress_ifaces    | engine (used only in binding.c) and hence there  |
+ * |                  | This is used internally within the runtime data  |
+ * | local_iface_ids  | engine (used only in binding.c) and hence there  |
  * |                  | there is no need to track.                       |
  *  ---------------------------------------------------------------------
  * |                  | Active tunnels is built in the                   |
@@ -1445,7 +1444,6 @@  en_runtime_data_init(struct engine_node *node OVS_UNUSED,
     sset_init(&data->local_lports);
     related_lports_init(&data->related_lports);
     sset_init(&data->active_tunnels);
-    sset_init(&data->egress_ifaces);
     smap_init(&data->local_iface_ids);
     local_binding_data_init(&data->lbinding_data);
     shash_init(&data->local_active_ports_ipv6_pd);
@@ -1465,7 +1463,6 @@  en_runtime_data_cleanup(void *data)
     sset_destroy(&rt_data->local_lports);
     related_lports_destroy(&rt_data->related_lports);
     sset_destroy(&rt_data->active_tunnels);
-    sset_destroy(&rt_data->egress_ifaces);
     smap_destroy(&rt_data->local_iface_ids);
     local_datapaths_destroy(&rt_data->local_datapaths);
     shash_destroy(&rt_data->local_active_ports_ipv6_pd);
@@ -1553,7 +1550,6 @@  init_binding_ctx(struct engine_node *node,
     b_ctx_out->related_lports = &rt_data->related_lports;
     b_ctx_out->related_lports_changed = false;
     b_ctx_out->non_vif_ports_changed = false;
-    b_ctx_out->egress_ifaces = &rt_data->egress_ifaces;
     b_ctx_out->lbinding_data = &rt_data->lbinding_data;
     b_ctx_out->local_iface_ids = &rt_data->local_iface_ids;
     b_ctx_out->postponed_ports = rt_data->postponed_ports;
@@ -1583,13 +1579,11 @@  en_runtime_data_run(struct engine_node *node, void *data)
         sset_destroy(local_lports);
         related_lports_destroy(&rt_data->related_lports);
         sset_destroy(active_tunnels);
-        sset_destroy(&rt_data->egress_ifaces);
         smap_destroy(&rt_data->local_iface_ids);
         hmap_init(local_datapaths);
         sset_init(local_lports);
         related_lports_init(&rt_data->related_lports);
         sset_init(active_tunnels);
-        sset_init(&rt_data->egress_ifaces);
         smap_init(&rt_data->local_iface_ids);
         local_binding_data_init(&rt_data->lbinding_data);
     }
diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at
index 8ac0a392c..ba329f0f6 100644
--- a/tests/ovn-performance.at
+++ b/tests/ovn-performance.at
@@ -559,11 +559,6 @@  OVN_CONTROLLER_EXPECT_NO_HIT(
     [ovn-nbctl --wait=hv set Logical_Switch_Port ln-public options:qos_burst=1000]
 )
 
-OVN_CONTROLLER_EXPECT_HIT(
-    [hv3], [lflow_run],
-    [as hv3 ovs-vsctl set interface vgw3 external-ids:ovn-egress-iface=true]
-)
-
 ovn-nbctl --wait=hv meter-add meter0 drop 100 pktps 10
 
 OVN_CONTROLLER_EXPECT_NO_HIT(