@@ -6,6 +6,8 @@ northd_ovn_northd_SOURCES = \
northd/ovn-northd.c \
northd/en-northd.c \
northd/en-northd.h \
+ northd/en-lflow.c \
+ northd/en-lflow.h \
northd/inc-proc-northd.c \
northd/inc-proc-northd.h \
northd/ipam.c \
new file mode 100644
@@ -0,0 +1,42 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <config.h>
+
+#include <getopt.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "en-lflow.h"
+#include "en-northd.h"
+
+#include "lib/inc-proc-eng.h"
+#include "northd.h"
+#include "openvswitch/vlog.h"
+
+VLOG_DEFINE_THIS_MODULE(en_lflow);
+
+void en_lflow_run(struct engine_node *node, void *data OVS_UNUSED)
+{
+ engine_set_node_state(node, EN_UPDATED);
+}
+void *en_lflow_init(struct engine_node *node OVS_UNUSED,
+ struct engine_arg *arg OVS_UNUSED)
+{
+ return NULL;
+}
+
+void en_lflow_cleanup(void *data OVS_UNUSED)
+{
+}
new file mode 100644
@@ -0,0 +1,16 @@
+#ifndef EN_LFLOW_H
+#define EN_LFLOW_H 1
+
+#include <config.h>
+
+#include <getopt.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "lib/inc-proc-eng.h"
+
+void en_lflow_run(struct engine_node *node, void *data);
+void *en_lflow_init(struct engine_node *node, struct engine_arg *arg);
+void en_lflow_cleanup(void *data);
+
+#endif /* EN_LFLOW_H */
@@ -25,6 +25,7 @@
#include "openvswitch/vlog.h"
#include "inc-proc-northd.h"
#include "en-northd.h"
+#include "en-lflow.h"
#include "util.h"
VLOG_DEFINE_THIS_MODULE(inc_proc_northd);
@@ -140,6 +141,7 @@ enum sb_engine_node {
/* Define engine nodes for other nodes. They should be defined as static to
* avoid sparse errors. */
static ENGINE_NODE(northd, "northd");
+static ENGINE_NODE(lflow, "lflow");
void inc_proc_northd_init(struct ovsdb_idl_loop *nb,
struct ovsdb_idl_loop *sb)
@@ -204,13 +206,14 @@ void inc_proc_northd_init(struct ovsdb_idl_loop *nb,
engine_add_input(&en_northd, &en_sb_load_balancer, NULL);
engine_add_input(&en_northd, &en_sb_bfd, NULL);
engine_add_input(&en_northd, &en_sb_fdb, NULL);
+ engine_add_input(&en_lflow, &en_northd, NULL);
struct engine_arg engine_arg = {
.nb_idl = nb->idl,
.sb_idl = sb->idl,
};
- engine_init(&en_northd, &engine_arg);
+ engine_init(&en_lflow, &engine_arg);
}
void inc_proc_northd_run(struct northd_idl_context *ctx,
@@ -12881,7 +12881,6 @@ struct lflows_thread_pool {
struct worker_pool *pool;
};
-
static void *
build_lflows_thread(void *arg)
{
@@ -14410,7 +14409,6 @@ ovnnb_db_run(struct northd_data *data,
cleanup_stale_fdp_entries(ctx, &data->datapaths);
bfd_cleanup_connections(ctx, &data->bfd_connections);
stopwatch_stop(CLEAR_LFLOWS_CTX_STOPWATCH_NAME, time_msec());
-
}
/* Stores the list of chassis which references an ha_chassis_group.
Add an additional node that initially does nothing. This serves as a template for how to add a new node. This node is inserted after the northd_node. This node will be updated in a later commit to generate logical flows for the SBDB. Signed-off-by: Mark Gray <mark.d.gray@redhat.com> --- northd/automake.mk | 2 ++ northd/en-lflow.c | 42 ++++++++++++++++++++++++++++++++++++++++ northd/en-lflow.h | 16 +++++++++++++++ northd/inc-proc-northd.c | 5 ++++- northd/northd.c | 2 -- 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 northd/en-lflow.c create mode 100644 northd/en-lflow.h