Skip to content

Commit

Permalink
northd: Add a new engine 'lr_stateful' to manage lr's stateful data.
Browse files Browse the repository at this point in the history
This new engine now maintains the load balancer and NAT data of a
logical router which was earlier part of northd engine node data.
The main inputs to this engine are:
   - northd node
   - lr_nat node
   - lb_data node

A record for each logical router is maintained in the 'lr_stateful_table'
hmap table and this record
   - stores the lb related data
   - embeds the 'lr_nat' record.

This engine node becomes an input to 'lflow' node.

Signed-off-by: Numan Siddique <numans@ovn.org>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
numansiddique authored and ovsrobot committed Jan 5, 2024
1 parent b7502d5 commit 6d06c73
Show file tree
Hide file tree
Showing 12 changed files with 1,210 additions and 515 deletions.
1 change: 1 addition & 0 deletions lib/stopwatch-names.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
#define PORT_GROUP_RUN_STOPWATCH_NAME "port_group_run"
#define SYNC_METERS_RUN_STOPWATCH_NAME "sync_meters_run"
#define LR_NAT_RUN_STOPWATCH_NAME "lr_nat_run"
#define LR_STATEFUL_RUN_STOPWATCH_NAME "lr_stateful"

#endif
2 changes: 2 additions & 0 deletions northd/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ northd_ovn_northd_SOURCES = \
northd/en-lb-data.h \
northd/en-lr-nat.c \
northd/en-lr-nat.h \
northd/en-lr-stateful.c \
northd/en-lr-stateful.h \
northd/inc-proc-northd.c \
northd/inc-proc-northd.h \
northd/ipam.c \
Expand Down
4 changes: 4 additions & 0 deletions northd/en-lflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "en-lflow.h"
#include "en-lr-nat.h"
#include "en-lr-stateful.h"
#include "en-northd.h"
#include "en-meters.h"

Expand All @@ -43,6 +44,8 @@ lflow_get_input_data(struct engine_node *node,
engine_get_input_data("sync_meters", node);
struct ed_type_lr_nat_data *lr_nat_data =
engine_get_input_data("lr_nat", node);
struct ed_type_lr_stateful *lr_stateful_data =
engine_get_input_data("lr_stateful", node);

lflow_input->nbrec_bfd_table =
EN_OVSDB_GET(engine_get_input("NB_bfd", node));
Expand All @@ -66,6 +69,7 @@ lflow_get_input_data(struct engine_node *node,
lflow_input->lr_ports = &northd_data->lr_ports;
lflow_input->ls_port_groups = &pg_data->ls_port_groups;
lflow_input->lr_nats = &lr_nat_data->lr_nats;
lflow_input->lr_stateful_table = &lr_stateful_data->table;
lflow_input->meter_groups = &sync_meters_data->meter_groups;
lflow_input->lb_datapaths_map = &northd_data->lb_datapaths_map;
lflow_input->svc_monitor_map = &northd_data->svc_monitor_map;
Expand Down
3 changes: 3 additions & 0 deletions northd/en-lr-nat.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ struct lr_nat_table {
const struct lr_nat_record * lr_nat_table_find_by_index(
const struct lr_nat_table *, size_t od_index);

#define LR_NAT_TABLE_FOR_EACH(LR_NAT_REC, TABLE) \
HMAP_FOR_EACH (LR_NAT_REC, key_node, &(TABLE)->entries)

struct ed_type_lr_nat_data {
struct lr_nat_table lr_nats;

Expand Down
Loading

0 comments on commit 6d06c73

Please sign in to comment.