Skip to content

Commit

Permalink
ic: lookup southbound port_binding only if needed
Browse files Browse the repository at this point in the history
Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from commit ff13373)
  • Loading branch information
odivlad authored and dceara committed Dec 16, 2022
1 parent 366512f commit 2a92afa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ic/ovn-ic.c
Expand Up @@ -761,6 +761,7 @@ port_binding_run(struct ic_context *ctx,
}
icsbrec_port_binding_index_destroy_row(isb_pb_key);

const struct sbrec_port_binding *sb_pb;
const struct icnbrec_transit_switch *ts;
ICNBREC_TRANSIT_SWITCH_FOR_EACH (ts, ctx->ovninb_idl) {
const struct nbrec_logical_switch *ls = find_ts_in_nb(ctx, ts->name);
Expand Down Expand Up @@ -792,9 +793,9 @@ port_binding_run(struct ic_context *ctx,
for (int i = 0; i < ls->n_ports; i++) {
lsp = ls->ports[i];

const struct sbrec_port_binding *sb_pb = find_lsp_in_sb(ctx, lsp);
if (!strcmp(lsp->type, "router")) {
/* The port is local. */
sb_pb = find_lsp_in_sb(ctx, lsp);
if (!sb_pb) {
continue;
}
Expand All @@ -811,6 +812,7 @@ port_binding_run(struct ic_context *ctx,
if (!isb_pb) {
nbrec_logical_switch_update_ports_delvalue(ls, lsp);
} else {
sb_pb = find_lsp_in_sb(ctx, lsp);
if (!sb_pb) {
continue;
}
Expand Down

0 comments on commit 2a92afa

Please sign in to comment.