Re: [ovs-dev] [PATCH ovn v5 07/16] northd: Add a new node 'ls_stateful'.

2024-01-26 Thread Dumitru Ceara
On 1/26/24 06:27, Numan Siddique wrote:
> On Wed, Jan 17, 2024 at 10:17 AM Dumitru Ceara  wrote:
>>
>> On 1/11/24 16:30, num...@ovn.org wrote:
>>> From: Numan Siddique 
>>>
>>> This new engine now maintains the load balancer and ACL data of a
>>> logical switch which was earlier part of northd engine node data.
>>> The main inputs to this engine are:
>>> - northd node
>>> - Port group node
>>>
>>> A record for each logical switch is maintained in the 'ls_statefuls'
>>> hmap table and this record stores the below data which was earlier
>>> part of 'struct ovn_datapath'.
>>>
>>> - bool has_stateful_acl;
>>> - bool has_lb_vip;
>>> - bool has_acls;
>>> - uint64_t max_acl_tier;
>>>
>>> This engine node becomes an input to 'lflow' node.
>>>
>>> If a logical switch is configured with
>>>- DHCP for all or some of its ports
>>>- stateful ACLs and/or load balancers
>>>
>>> ovn-northd was adding flows to commit the DHCP response generated by
>>> ovn-controller to conntrack.  With this patch we don't commit the
>>> DHCP response to conntrack anymore for the following reasons:
>>>   1.  There is no need to actually commit the response.
>>>   2.  Since stateful information is moved to 'ls_stateful' node, it
>>>   becomes ineffecient to access ls_stateful's data
>>>   ('has_lb_vip' and 'has_acls') in build_dhcpv4_options_flows().
>>>
>>> Signed-off-by: Numan Siddique 
>>> ---
>>
>> Hi Numan,
>>
>> Overall this looks correct to me.  I only had a few minor comments,
>> please see below.
>>
>> If you address them feel free to add my ack:
>>
>> Acked-by: Dumitru Ceara 
>>
>> Thanks,
>> Dumitru
>>
>>>  lib/stopwatch-names.h|   1 +
>>>  northd/automake.mk   |   2 +
>>>  northd/en-lflow.c|   4 +
>>>  northd/en-lr-stateful.c  |   6 +-
>>>  northd/en-lr-stateful.h  |   2 +
>>>  northd/en-ls-stateful.c  | 440 +++
>>>  northd/en-ls-stateful.h  |  81 +++
>>>  northd/en-northd.c   |   2 +-
>>>  northd/en-port-group.h   |   3 +
>>>  northd/inc-proc-northd.c |   7 +
>>>  northd/northd.c  | 335 +++--
>>>  northd/northd.h  |  29 ++-
>>>  northd/ovn-northd.c  |   1 +
>>>  13 files changed, 753 insertions(+), 160 deletions(-)
>>>  create mode 100644 northd/en-ls-stateful.c
>>>  create mode 100644 northd/en-ls-stateful.h
>>>
>>> diff --git a/lib/stopwatch-names.h b/lib/stopwatch-names.h
>>> index e5e41fbfd8..c865f125be 100644
>>> --- a/lib/stopwatch-names.h
>>> +++ b/lib/stopwatch-names.h
>>> @@ -31,5 +31,6 @@
>>>  #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"
>>> +#define LS_STATEFUL_RUN_STOPWATCH_NAME "ls_stateful"
>>>
>>>  #endif
>>> diff --git a/northd/automake.mk b/northd/automake.mk
>>> index b886356c9c..a178541759 100644
>>> --- a/northd/automake.mk
>>> +++ b/northd/automake.mk
>>> @@ -28,6 +28,8 @@ northd_ovn_northd_SOURCES = \
>>>   northd/en-lr-nat.h \
>>>   northd/en-lr-stateful.c \
>>>   northd/en-lr-stateful.h \
>>> + northd/en-ls-stateful.c \
>>> + northd/en-ls-stateful.h \
>>>   northd/inc-proc-northd.c \
>>>   northd/inc-proc-northd.h \
>>>   northd/ipam.c \
>>> diff --git a/northd/en-lflow.c b/northd/en-lflow.c
>>> index a3a0d62f15..eb6b2a8666 100644
>>> --- a/northd/en-lflow.c
>>> +++ b/northd/en-lflow.c
>>> @@ -21,6 +21,7 @@
>>>  #include "en-lflow.h"
>>>  #include "en-lr-nat.h"
>>>  #include "en-lr-stateful.h"
>>> +#include "en-ls-stateful.h"
>>>  #include "en-northd.h"
>>>  #include "en-meters.h"
>>>
>>> @@ -44,6 +45,8 @@ lflow_get_input_data(struct engine_node *node,
>>>  engine_get_input_data("sync_meters", node);
>>>  struct ed_type_lr_stateful *lr_stateful_data =
>>>  engine_get_input_data("lr_stateful", node);
>>> +struct ed_type_ls_stateful *ls_stateful_data =
>>> +engine_get_input_data("ls_stateful", node);
>>>
>>>  lflow_input->nbrec_bfd_table =
>>>  EN_OVSDB_GET(engine_get_input("NB_bfd", node));
>>> @@ -67,6 +70,7 @@ lflow_get_input_data(struct engine_node *node,
>>>  lflow_input->lr_ports = _data->lr_ports;
>>>  lflow_input->ls_port_groups = _data->ls_port_groups;
>>>  lflow_input->lr_stateful_table = _stateful_data->table;
>>> +lflow_input->ls_stateful_table = _stateful_data->table;
>>>  lflow_input->meter_groups = _meters_data->meter_groups;
>>>  lflow_input->lb_datapaths_map = _data->lb_datapaths_map;
>>>  lflow_input->svc_monitor_map = _data->svc_monitor_map;
>>> diff --git a/northd/en-lr-stateful.c b/northd/en-lr-stateful.c
>>> index dedfdf6747..4287aaddc9 100644
>>> --- a/northd/en-lr-stateful.c
>>> +++ b/northd/en-lr-stateful.c
>>> @@ -295,7 +295,9 @@ lr_stateful_lb_data_handler(struct engine_node *node, 
>>> void *data_)
>>>  /* For all the modified lr_stateful records (re)build the
>>>   * vip nats. */
>>>  

Re: [ovs-dev] [PATCH ovn v5 07/16] northd: Add a new node 'ls_stateful'.

2024-01-25 Thread Numan Siddique
On Wed, Jan 17, 2024 at 10:17 AM Dumitru Ceara  wrote:
>
> On 1/11/24 16:30, num...@ovn.org wrote:
> > From: Numan Siddique 
> >
> > This new engine now maintains the load balancer and ACL data of a
> > logical switch which was earlier part of northd engine node data.
> > The main inputs to this engine are:
> > - northd node
> > - Port group node
> >
> > A record for each logical switch is maintained in the 'ls_statefuls'
> > hmap table and this record stores the below data which was earlier
> > part of 'struct ovn_datapath'.
> >
> > - bool has_stateful_acl;
> > - bool has_lb_vip;
> > - bool has_acls;
> > - uint64_t max_acl_tier;
> >
> > This engine node becomes an input to 'lflow' node.
> >
> > If a logical switch is configured with
> >- DHCP for all or some of its ports
> >- stateful ACLs and/or load balancers
> >
> > ovn-northd was adding flows to commit the DHCP response generated by
> > ovn-controller to conntrack.  With this patch we don't commit the
> > DHCP response to conntrack anymore for the following reasons:
> >   1.  There is no need to actually commit the response.
> >   2.  Since stateful information is moved to 'ls_stateful' node, it
> >   becomes ineffecient to access ls_stateful's data
> >   ('has_lb_vip' and 'has_acls') in build_dhcpv4_options_flows().
> >
> > Signed-off-by: Numan Siddique 
> > ---
>
> Hi Numan,
>
> Overall this looks correct to me.  I only had a few minor comments,
> please see below.
>
> If you address them feel free to add my ack:
>
> Acked-by: Dumitru Ceara 
>
> Thanks,
> Dumitru
>
> >  lib/stopwatch-names.h|   1 +
> >  northd/automake.mk   |   2 +
> >  northd/en-lflow.c|   4 +
> >  northd/en-lr-stateful.c  |   6 +-
> >  northd/en-lr-stateful.h  |   2 +
> >  northd/en-ls-stateful.c  | 440 +++
> >  northd/en-ls-stateful.h  |  81 +++
> >  northd/en-northd.c   |   2 +-
> >  northd/en-port-group.h   |   3 +
> >  northd/inc-proc-northd.c |   7 +
> >  northd/northd.c  | 335 +++--
> >  northd/northd.h  |  29 ++-
> >  northd/ovn-northd.c  |   1 +
> >  13 files changed, 753 insertions(+), 160 deletions(-)
> >  create mode 100644 northd/en-ls-stateful.c
> >  create mode 100644 northd/en-ls-stateful.h
> >
> > diff --git a/lib/stopwatch-names.h b/lib/stopwatch-names.h
> > index e5e41fbfd8..c865f125be 100644
> > --- a/lib/stopwatch-names.h
> > +++ b/lib/stopwatch-names.h
> > @@ -31,5 +31,6 @@
> >  #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"
> > +#define LS_STATEFUL_RUN_STOPWATCH_NAME "ls_stateful"
> >
> >  #endif
> > diff --git a/northd/automake.mk b/northd/automake.mk
> > index b886356c9c..a178541759 100644
> > --- a/northd/automake.mk
> > +++ b/northd/automake.mk
> > @@ -28,6 +28,8 @@ northd_ovn_northd_SOURCES = \
> >   northd/en-lr-nat.h \
> >   northd/en-lr-stateful.c \
> >   northd/en-lr-stateful.h \
> > + northd/en-ls-stateful.c \
> > + northd/en-ls-stateful.h \
> >   northd/inc-proc-northd.c \
> >   northd/inc-proc-northd.h \
> >   northd/ipam.c \
> > diff --git a/northd/en-lflow.c b/northd/en-lflow.c
> > index a3a0d62f15..eb6b2a8666 100644
> > --- a/northd/en-lflow.c
> > +++ b/northd/en-lflow.c
> > @@ -21,6 +21,7 @@
> >  #include "en-lflow.h"
> >  #include "en-lr-nat.h"
> >  #include "en-lr-stateful.h"
> > +#include "en-ls-stateful.h"
> >  #include "en-northd.h"
> >  #include "en-meters.h"
> >
> > @@ -44,6 +45,8 @@ lflow_get_input_data(struct engine_node *node,
> >  engine_get_input_data("sync_meters", node);
> >  struct ed_type_lr_stateful *lr_stateful_data =
> >  engine_get_input_data("lr_stateful", node);
> > +struct ed_type_ls_stateful *ls_stateful_data =
> > +engine_get_input_data("ls_stateful", node);
> >
> >  lflow_input->nbrec_bfd_table =
> >  EN_OVSDB_GET(engine_get_input("NB_bfd", node));
> > @@ -67,6 +70,7 @@ lflow_get_input_data(struct engine_node *node,
> >  lflow_input->lr_ports = _data->lr_ports;
> >  lflow_input->ls_port_groups = _data->ls_port_groups;
> >  lflow_input->lr_stateful_table = _stateful_data->table;
> > +lflow_input->ls_stateful_table = _stateful_data->table;
> >  lflow_input->meter_groups = _meters_data->meter_groups;
> >  lflow_input->lb_datapaths_map = _data->lb_datapaths_map;
> >  lflow_input->svc_monitor_map = _data->svc_monitor_map;
> > diff --git a/northd/en-lr-stateful.c b/northd/en-lr-stateful.c
> > index dedfdf6747..4287aaddc9 100644
> > --- a/northd/en-lr-stateful.c
> > +++ b/northd/en-lr-stateful.c
> > @@ -295,7 +295,9 @@ lr_stateful_lb_data_handler(struct engine_node *node, 
> > void *data_)
> >  /* For all the modified lr_stateful records (re)build the
> >   * vip nats. */
> >  HMAPX_FOR_EACH (hmapx_node, >trk_data.crupdated) {
> > -

Re: [ovs-dev] [PATCH ovn v5 07/16] northd: Add a new node 'ls_stateful'.

2024-01-17 Thread Dumitru Ceara
On 1/11/24 16:30, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> This new engine now maintains the load balancer and ACL data of a
> logical switch which was earlier part of northd engine node data.
> The main inputs to this engine are:
> - northd node
> - Port group node
> 
> A record for each logical switch is maintained in the 'ls_statefuls'
> hmap table and this record stores the below data which was earlier
> part of 'struct ovn_datapath'.
> 
> - bool has_stateful_acl;
> - bool has_lb_vip;
> - bool has_acls;
> - uint64_t max_acl_tier;
> 
> This engine node becomes an input to 'lflow' node.
> 
> If a logical switch is configured with
>- DHCP for all or some of its ports
>- stateful ACLs and/or load balancers
> 
> ovn-northd was adding flows to commit the DHCP response generated by
> ovn-controller to conntrack.  With this patch we don't commit the
> DHCP response to conntrack anymore for the following reasons:
>   1.  There is no need to actually commit the response.
>   2.  Since stateful information is moved to 'ls_stateful' node, it
>   becomes ineffecient to access ls_stateful's data
>   ('has_lb_vip' and 'has_acls') in build_dhcpv4_options_flows().
> 
> Signed-off-by: Numan Siddique 
> ---

Hi Numan,

Overall this looks correct to me.  I only had a few minor comments,
please see below.

If you address them feel free to add my ack:

Acked-by: Dumitru Ceara 

Thanks,
Dumitru

>  lib/stopwatch-names.h|   1 +
>  northd/automake.mk   |   2 +
>  northd/en-lflow.c|   4 +
>  northd/en-lr-stateful.c  |   6 +-
>  northd/en-lr-stateful.h  |   2 +
>  northd/en-ls-stateful.c  | 440 +++
>  northd/en-ls-stateful.h  |  81 +++
>  northd/en-northd.c   |   2 +-
>  northd/en-port-group.h   |   3 +
>  northd/inc-proc-northd.c |   7 +
>  northd/northd.c  | 335 +++--
>  northd/northd.h  |  29 ++-
>  northd/ovn-northd.c  |   1 +
>  13 files changed, 753 insertions(+), 160 deletions(-)
>  create mode 100644 northd/en-ls-stateful.c
>  create mode 100644 northd/en-ls-stateful.h
> 
> diff --git a/lib/stopwatch-names.h b/lib/stopwatch-names.h
> index e5e41fbfd8..c865f125be 100644
> --- a/lib/stopwatch-names.h
> +++ b/lib/stopwatch-names.h
> @@ -31,5 +31,6 @@
>  #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"
> +#define LS_STATEFUL_RUN_STOPWATCH_NAME "ls_stateful"
>  
>  #endif
> diff --git a/northd/automake.mk b/northd/automake.mk
> index b886356c9c..a178541759 100644
> --- a/northd/automake.mk
> +++ b/northd/automake.mk
> @@ -28,6 +28,8 @@ northd_ovn_northd_SOURCES = \
>   northd/en-lr-nat.h \
>   northd/en-lr-stateful.c \
>   northd/en-lr-stateful.h \
> + northd/en-ls-stateful.c \
> + northd/en-ls-stateful.h \
>   northd/inc-proc-northd.c \
>   northd/inc-proc-northd.h \
>   northd/ipam.c \
> diff --git a/northd/en-lflow.c b/northd/en-lflow.c
> index a3a0d62f15..eb6b2a8666 100644
> --- a/northd/en-lflow.c
> +++ b/northd/en-lflow.c
> @@ -21,6 +21,7 @@
>  #include "en-lflow.h"
>  #include "en-lr-nat.h"
>  #include "en-lr-stateful.h"
> +#include "en-ls-stateful.h"
>  #include "en-northd.h"
>  #include "en-meters.h"
>  
> @@ -44,6 +45,8 @@ lflow_get_input_data(struct engine_node *node,
>  engine_get_input_data("sync_meters", node);
>  struct ed_type_lr_stateful *lr_stateful_data =
>  engine_get_input_data("lr_stateful", node);
> +struct ed_type_ls_stateful *ls_stateful_data =
> +engine_get_input_data("ls_stateful", node);
>  
>  lflow_input->nbrec_bfd_table =
>  EN_OVSDB_GET(engine_get_input("NB_bfd", node));
> @@ -67,6 +70,7 @@ lflow_get_input_data(struct engine_node *node,
>  lflow_input->lr_ports = _data->lr_ports;
>  lflow_input->ls_port_groups = _data->ls_port_groups;
>  lflow_input->lr_stateful_table = _stateful_data->table;
> +lflow_input->ls_stateful_table = _stateful_data->table;
>  lflow_input->meter_groups = _meters_data->meter_groups;
>  lflow_input->lb_datapaths_map = _data->lb_datapaths_map;
>  lflow_input->svc_monitor_map = _data->svc_monitor_map;
> diff --git a/northd/en-lr-stateful.c b/northd/en-lr-stateful.c
> index dedfdf6747..4287aaddc9 100644
> --- a/northd/en-lr-stateful.c
> +++ b/northd/en-lr-stateful.c
> @@ -295,7 +295,9 @@ lr_stateful_lb_data_handler(struct engine_node *node, 
> void *data_)
>  /* For all the modified lr_stateful records (re)build the
>   * vip nats. */
>  HMAPX_FOR_EACH (hmapx_node, >trk_data.crupdated) {
> -lr_stateful_build_vip_nats(hmapx_node->data);
> +struct lr_stateful_record *lr_stateful_rec = hmapx_node->data;
> +lr_stateful_build_vip_nats(lr_stateful_rec);
> +lr_stateful_rec->has_lb_vip = od_has_lb_vip(lr_stateful_rec->od);
>  }
>  
>

Re: [ovs-dev] [PATCH ovn v5 07/16] northd: Add a new node 'ls_stateful'.

2024-01-11 Thread 0-day Robot
Bleep bloop.  Greetings Numan Siddique, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Inappropriate bracing around statement
#644 FILE: northd/en-ls-stateful.h:49:
HMAP_FOR_EACH (LS_STATEFUL_REC, key_node, &(TABLE)->entries)

ERROR: Inappropriate bracing around statement
#699 FILE: northd/en-port-group.h:52:
HMAP_FOR_EACH (LS_PG, key_node, &(TABLE)->entries)

Lines checked: 1711, Warnings: 0, Errors: 2


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH ovn v5 07/16] northd: Add a new node 'ls_stateful'.

2024-01-11 Thread numans
From: Numan Siddique 

This new engine now maintains the load balancer and ACL data of a
logical switch which was earlier part of northd engine node data.
The main inputs to this engine are:
- northd node
- Port group node

A record for each logical switch is maintained in the 'ls_statefuls'
hmap table and this record stores the below data which was earlier
part of 'struct ovn_datapath'.

- bool has_stateful_acl;
- bool has_lb_vip;
- bool has_acls;
- uint64_t max_acl_tier;

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

If a logical switch is configured with
   - DHCP for all or some of its ports
   - stateful ACLs and/or load balancers

ovn-northd was adding flows to commit the DHCP response generated by
ovn-controller to conntrack.  With this patch we don't commit the
DHCP response to conntrack anymore for the following reasons:
  1.  There is no need to actually commit the response.
  2.  Since stateful information is moved to 'ls_stateful' node, it
  becomes ineffecient to access ls_stateful's data
  ('has_lb_vip' and 'has_acls') in build_dhcpv4_options_flows().

Signed-off-by: Numan Siddique 
---
 lib/stopwatch-names.h|   1 +
 northd/automake.mk   |   2 +
 northd/en-lflow.c|   4 +
 northd/en-lr-stateful.c  |   6 +-
 northd/en-lr-stateful.h  |   2 +
 northd/en-ls-stateful.c  | 440 +++
 northd/en-ls-stateful.h  |  81 +++
 northd/en-northd.c   |   2 +-
 northd/en-port-group.h   |   3 +
 northd/inc-proc-northd.c |   7 +
 northd/northd.c  | 335 +++--
 northd/northd.h  |  29 ++-
 northd/ovn-northd.c  |   1 +
 13 files changed, 753 insertions(+), 160 deletions(-)
 create mode 100644 northd/en-ls-stateful.c
 create mode 100644 northd/en-ls-stateful.h

diff --git a/lib/stopwatch-names.h b/lib/stopwatch-names.h
index e5e41fbfd8..c865f125be 100644
--- a/lib/stopwatch-names.h
+++ b/lib/stopwatch-names.h
@@ -31,5 +31,6 @@
 #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"
+#define LS_STATEFUL_RUN_STOPWATCH_NAME "ls_stateful"
 
 #endif
diff --git a/northd/automake.mk b/northd/automake.mk
index b886356c9c..a178541759 100644
--- a/northd/automake.mk
+++ b/northd/automake.mk
@@ -28,6 +28,8 @@ northd_ovn_northd_SOURCES = \
northd/en-lr-nat.h \
northd/en-lr-stateful.c \
northd/en-lr-stateful.h \
+   northd/en-ls-stateful.c \
+   northd/en-ls-stateful.h \
northd/inc-proc-northd.c \
northd/inc-proc-northd.h \
northd/ipam.c \
diff --git a/northd/en-lflow.c b/northd/en-lflow.c
index a3a0d62f15..eb6b2a8666 100644
--- a/northd/en-lflow.c
+++ b/northd/en-lflow.c
@@ -21,6 +21,7 @@
 #include "en-lflow.h"
 #include "en-lr-nat.h"
 #include "en-lr-stateful.h"
+#include "en-ls-stateful.h"
 #include "en-northd.h"
 #include "en-meters.h"
 
@@ -44,6 +45,8 @@ lflow_get_input_data(struct engine_node *node,
 engine_get_input_data("sync_meters", node);
 struct ed_type_lr_stateful *lr_stateful_data =
 engine_get_input_data("lr_stateful", node);
+struct ed_type_ls_stateful *ls_stateful_data =
+engine_get_input_data("ls_stateful", node);
 
 lflow_input->nbrec_bfd_table =
 EN_OVSDB_GET(engine_get_input("NB_bfd", node));
@@ -67,6 +70,7 @@ lflow_get_input_data(struct engine_node *node,
 lflow_input->lr_ports = _data->lr_ports;
 lflow_input->ls_port_groups = _data->ls_port_groups;
 lflow_input->lr_stateful_table = _stateful_data->table;
+lflow_input->ls_stateful_table = _stateful_data->table;
 lflow_input->meter_groups = _meters_data->meter_groups;
 lflow_input->lb_datapaths_map = _data->lb_datapaths_map;
 lflow_input->svc_monitor_map = _data->svc_monitor_map;
diff --git a/northd/en-lr-stateful.c b/northd/en-lr-stateful.c
index dedfdf6747..4287aaddc9 100644
--- a/northd/en-lr-stateful.c
+++ b/northd/en-lr-stateful.c
@@ -295,7 +295,9 @@ lr_stateful_lb_data_handler(struct engine_node *node, void 
*data_)
 /* For all the modified lr_stateful records (re)build the
  * vip nats. */
 HMAPX_FOR_EACH (hmapx_node, >trk_data.crupdated) {
-lr_stateful_build_vip_nats(hmapx_node->data);
+struct lr_stateful_record *lr_stateful_rec = hmapx_node->data;
+lr_stateful_build_vip_nats(lr_stateful_rec);
+lr_stateful_rec->has_lb_vip = od_has_lb_vip(lr_stateful_rec->od);
 }
 
 engine_set_node_state(node, EN_UPDATED);
@@ -510,6 +512,8 @@ lr_stateful_record_init(struct lr_stateful_record 
*lr_stateful_rec,
 if (nbr->n_nat) {
 lr_stateful_build_vip_nats(lr_stateful_rec);
 }
+
+lr_stateful_rec->has_lb_vip = od_has_lb_vip(lr_stateful_rec->od);
 }
 
 static struct lr_stateful_input
diff --git a/northd/en-lr-stateful.h b/northd/en-lr-stateful.h
index 74029c9a6c..5d647d8863 100644
---