Skip to content

Commit

Permalink
controller: get rid of egress_ifaces sset
Browse files Browse the repository at this point in the history
egress_ifaces sset is no longer used by ovn-controller, so get rid of it

Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
  • Loading branch information
LorenzoBianconi authored and putnopvut committed May 18, 2023
1 parent 1c99a50 commit 842550c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 49 deletions.
40 changes: 0 additions & 40 deletions controller/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,39 +472,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)
Expand Down Expand Up @@ -545,17 +512,13 @@ 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. */
if (!is_network_plugged(binding_rec, bridge_mappings)) {
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);
Expand Down Expand Up @@ -2125,7 +2088,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);
}
Expand Down Expand Up @@ -2928,7 +2890,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;
Expand Down Expand Up @@ -3124,7 +3085,6 @@ binding_handle_port_binding_changes(struct binding_ctx_in *b_ctx_in,
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);
Expand Down
1 change: 0 additions & 1 deletion controller/binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ struct binding_ctx_out {
*/
bool non_vif_ports_changed;

struct sset *egress_ifaces;
struct hmap *qos_map;
/* smap of OVS interface name as key and
* OVS interface external_ids:iface-id as value. */
Expand Down
10 changes: 2 additions & 8 deletions controller/ovn-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,6 @@ struct ed_type_runtime_data {
struct sset active_tunnels;

/* runtime data engine private data. */
struct sset egress_ifaces;
struct hmap qos_map;
struct smap local_iface_ids;

Expand Down Expand Up @@ -1408,8 +1407,8 @@ struct ed_type_runtime_data {
* | 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 |
* | qos_map | there is no need to track. |
* | qos_map | engine (used only in binding.c) and hence there |
* | | there is no need to track. |
* ---------------------------------------------------------------------
* | | Active tunnels is built in the |
* | | bfd_calculate_active_tunnels() for the tunnel |
Expand Down Expand Up @@ -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);
hmap_init(&data->qos_map);
smap_init(&data->local_iface_ids);
local_binding_data_init(&data->lbinding_data);
Expand All @@ -1466,7 +1464,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);
destroy_qos_map(&rt_data->qos_map);
smap_destroy(&rt_data->local_iface_ids);
local_datapaths_destroy(&rt_data->local_datapaths);
Expand Down Expand Up @@ -1556,7 +1553,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->qos_map = &rt_data->qos_map;
b_ctx_out->lbinding_data = &rt_data->lbinding_data;
b_ctx_out->local_iface_ids = &rt_data->local_iface_ids;
Expand Down Expand Up @@ -1587,14 +1583,12 @@ 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);
destroy_qos_map(&rt_data->qos_map);
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);
hmap_init(&rt_data->qos_map);
smap_init(&rt_data->local_iface_ids);
local_binding_data_init(&rt_data->lbinding_data);
Expand Down

0 comments on commit 842550c

Please sign in to comment.