Skip to content

Commit

Permalink
northd: Add I-P for NB_Global and SB_Global.
Browse files Browse the repository at this point in the history
A new engine node "global_config" is added which handles the changes
to NB_Global an SB_Global tables.  It also creates these rows if
not present.

Without the I-P, any changes to the options column of these tables
result in recompute of 'northd' and 'lflow' engine nodes.

Acked-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Han Zhou <hzhou@ovn.org>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
numansiddique committed Feb 2, 2024
1 parent 6f24a48 commit aed60ee
Show file tree
Hide file tree
Showing 12 changed files with 965 additions and 297 deletions.
21 changes: 11 additions & 10 deletions northd/aging.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <config.h>

#include "en-global-config.h"
#include "lib/inc-proc-eng.h"
#include "lib/ovn-nb-idl.h"
#include "lib/ovn-sb-idl.h"
Expand Down Expand Up @@ -347,15 +348,10 @@ aging_context_handle_timestamp(struct aging_context *ctx, int64_t timestamp,
static uint32_t
get_removal_limit(struct engine_node *node, const char *name)
{
const struct nbrec_nb_global_table *nb_global_table =
EN_OVSDB_GET(engine_get_input("NB_nb_global", node));
const struct nbrec_nb_global *nb =
nbrec_nb_global_table_first(nb_global_table);
if (!nb) {
return 0;
}
struct ed_type_global_config *global_config =
engine_get_input_data("global_config", node);

return smap_get_uint(&nb->options, name, 0);
return smap_get_uint(&global_config->nb_options, name, 0);
}

/* MAC binding aging */
Expand Down Expand Up @@ -394,11 +390,14 @@ en_mac_binding_aging_run(struct engine_node *node, void *data OVS_UNUSED)
{
const struct engine_context *eng_ctx = engine_get_context();
struct northd_data *northd_data = engine_get_input_data("northd", node);
struct ed_type_global_config *global_config =
engine_get_input_data("global_config", node);

struct aging_waker *waker =
engine_get_input_data("mac_binding_aging_waker", node);

if (!eng_ctx->ovnsb_idl_txn ||
!northd_data->features.mac_binding_timestamp ||
!global_config->features.mac_binding_timestamp ||
time_msec() < waker->next_wake_msec) {
return;
}
Expand Down Expand Up @@ -530,9 +529,11 @@ en_fdb_aging_run(struct engine_node *node, void *data OVS_UNUSED)
const struct engine_context *eng_ctx = engine_get_context();
struct northd_data *northd_data = engine_get_input_data("northd", node);
struct aging_waker *waker = engine_get_input_data("fdb_aging_waker", node);
struct ed_type_global_config *global_config =
engine_get_input_data("global_config", node);

if (!eng_ctx->ovnsb_idl_txn ||
!northd_data->features.fdb_timestamp ||
!global_config->features.fdb_timestamp ||
time_msec() < waker->next_wake_msec) {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions northd/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ northd_ovn_northd_SOURCES = \
northd/northd.c \
northd/northd.h \
northd/ovn-northd.c \
northd/en-global-config.c \
northd/en-global-config.h \
northd/en-northd.c \
northd/en-northd.h \
northd/en-lflow.c \
Expand Down

0 comments on commit aed60ee

Please sign in to comment.