Skip to content

Commit

Permalink
controller: Reduce the time it takes to remove multiple ports.
Browse files Browse the repository at this point in the history
Multichassis reprocessing could increase the time for processing
the removal of ports. The issue is we could actually process
multiple ports over and over if there did belong into single
datapath. To prevent that create set of ports that were already
reprocessed for the multichassis in the current I-P run and do
not reprocess them again. This greatly reduces the amount of
precessing during removal as shown below with the test that
removes 1000 ports in a single transaction.

Without:
physical_flow_output, handler for input runtime_data took 992ms

With:
physical_flow_output, handler for input runtime_data took 58ms

Reported-at: https://issues.redhat.com/browse/FDP-1012
Signed-off-by: Ales Musil <[email protected]>
Signed-off-by: Dumitru Ceara <[email protected]>
(cherry picked from commit f62e525)
  • Loading branch information
almusil authored and dceara committed Dec 23, 2024
1 parent c0d27b8 commit ffbe5a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controller/ovn-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -4353,6 +4353,7 @@ static void init_physical_ctx(struct engine_node *node,
p_ctx->if_mgr = ctrl_ctx->if_mgr;

pflow_output_get_debug(node, &p_ctx->debug);
sset_init(&p_ctx->reprocessed_pbs);
}

static void
Expand All @@ -4362,6 +4363,7 @@ destroy_physical_ctx(struct physical_ctx *p_ctx)
free((char *)(p_ctx->encap_ips[i]));
}
free(p_ctx->encap_ips);
sset_destroy(&p_ctx->reprocessed_pbs);
}

static void *
Expand Down
5 changes: 5 additions & 0 deletions controller/physical.c
Original file line number Diff line number Diff line change
Expand Up @@ -2438,6 +2438,11 @@ physical_multichassis_reprocess(const struct sbrec_port_binding *pb,
const struct sbrec_port_binding *port;
SBREC_PORT_BINDING_FOR_EACH_EQUAL (port, target,
p_ctx->sbrec_port_binding_by_datapath) {
/* Ignore PBs that were already reprocessed. */
if (!sset_add(&p_ctx->reprocessed_pbs, port->logical_port)) {
continue;
}

ofctrl_remove_flows(flow_table, &port->header_.uuid);
physical_eval_port_binding(p_ctx, port, flow_table);
}
Expand Down
3 changes: 3 additions & 0 deletions controller/physical.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ struct physical_ctx {
const char **encap_ips;
struct physical_debug debug;
bool always_tunnel;
/* Set of port binding names that have been already reprocessed during
* the I-P run. */
struct sset reprocessed_pbs;
};

void physical_register_ovs_idl(struct ovsdb_idl *);
Expand Down

0 comments on commit ffbe5a9

Please sign in to comment.