Re: [ovs-dev] [PATCH ovn v5 15/16] northd: Add northd change handler for sync_to_sb_lb node.

2024-01-19 Thread Dumitru Ceara
On 1/11/24 16:34, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> Any changes to northd engine node due to load balancers
> are now handled in 'sync_to_sb_lb' node to sync the changed
> load balancers to SB load balancers.
> 
> The logic to sync the SB load balancers is changed a bit and it
> now mimics the SB lflow sync.
> 
> Below are the scale testing results done with all the patches applied
> in this series using ovn-heater.  The test ran the scenario  -
> ocp-500-density-heavy.yml [1].
> 
> The resuts are:
> 
> ---
>   Min (s) Median (s)  90%ile (s)  99%ile 
> (s)  Max (s) Mean (s)Total (s)   Count   Failed
> ---
> Iteration Total   0.1368831.1290161.192001
> 1.2041671.2127280.66501783.127099   125 0
> Namespace.add_ports   0.0052160.0057360.007034
> 0.0154860.0189780.0062110.776373125 0
> WorkerNode.bind_port  0.0350300.0460820.052469
> 0.0582930.0603110.04597311.493259   250 0
> WorkerNode.ping_port  0.0050570.0067271.047692
> 1.0692531.0713360.26689666.724094   250 0
> ---
> 
> The results with the present main [2] are:
> 
> ---
>   Min (s) Median (s)  90%ile (s)  99%ile 
> (s)  Max (s) Mean (s)Total (s)   Count   Failed
> ---
> Iteration Total   0.1354912.2238053.311270
> 3.3390783.3453461.729172216.146495  125 0
> Namespace.add_ports   0.0053800.0057440.006819
> 0.0187730.0208000.0062920.786532125 0
> WorkerNode.bind_port  0.0341790.0460550.053488
> 0.0588010.0710430.04611711.529311   250 0
> WorkerNode.ping_port  0.0049560.0069523.086952
> 3.1917433.1928070.791544197.886026  250 0
> ---
> 
> [1] - 
> https://github.com/ovn-org/ovn-heater/blob/main/test-scenarios/ocp-500-density-heavy.yml
> [2] - 2a12cda890a7("controller, northd: Wait for cleanup before replying to 
> exit")
> 
> Signed-off-by: Numan Siddique 
> ---

Hi Numan,

I only have a few minor comments, please see inline.  With those
addressed I think the patch is correct:

Acked-by: Dumitru Ceara 

Thanks,
Dumitru

>  northd/en-sync-sb.c  | 505 +--
>  northd/inc-proc-northd.c |   1 +
>  northd/lflow-mgr.c   | 196 ++-
>  northd/lflow-mgr.h   |  23 +-
>  northd/northd.c  | 238 --
>  northd/northd.h  |   6 -
>  tests/ovn-northd.at  | 164 ++---
>  7 files changed, 705 insertions(+), 428 deletions(-)
> 
> diff --git a/northd/en-sync-sb.c b/northd/en-sync-sb.c
> index d39cbbf2e6..80f3621bb9 100644
> --- a/northd/en-sync-sb.c
> +++ b/northd/en-sync-sb.c
> @@ -18,17 +18,21 @@
>  #include 
>  #include 
>  
> +/* OVS includes. */
>  #include "lib/svec.h"
>  #include "openvswitch/util.h"
>  
> +/* OVN includes. */
>  #include "en-lr-nat.h"
>  #include "en-lr-stateful.h"
>  #include "en-sync-sb.h"
> +#include "lb.h"
>  #include "lib/inc-proc-eng.h"
>  #include "lib/lb.h"
>  #include "lib/ovn-nb-idl.h"
>  #include "lib/ovn-sb-idl.h"
>  #include "lib/ovn-util.h"
> +#include "lflow-mgr.h"
>  #include "northd.h"
>  
>  #include "openvswitch/vlog.h"
> @@ -51,6 +55,40 @@ static void build_port_group_address_set(const struct 
> nbrec_port_group *,
>   struct svec *ipv4_addrs,
>   struct svec *ipv6_addrs);
>  
> +struct sb_lb_table;
> +struct sb_lb_record;

These are defined just below.  Let's move the prototypes after the
struct definition?

> +static void sb_lb_table_init(struct sb_lb_table *);
> +static void sb_lb_table_clear(struct sb_lb_table *);
> +static void sb_lb_table_destroy(struct sb_lb_table *);
> +
>

[ovs-dev] [PATCH ovn v5 15/16] northd: Add northd change handler for sync_to_sb_lb node.

2024-01-11 Thread numans
From: Numan Siddique 

Any changes to northd engine node due to load balancers
are now handled in 'sync_to_sb_lb' node to sync the changed
load balancers to SB load balancers.

The logic to sync the SB load balancers is changed a bit and it
now mimics the SB lflow sync.

Below are the scale testing results done with all the patches applied
in this series using ovn-heater.  The test ran the scenario  -
ocp-500-density-heavy.yml [1].

The resuts are:

---
Min (s) Median (s)  90%ile (s)  99%ile 
(s)  Max (s) Mean (s)Total (s)   Count   Failed
---
Iteration Total 0.1368831.1290161.192001
1.2041671.2127280.66501783.127099   125 0
Namespace.add_ports 0.0052160.0057360.007034
0.0154860.0189780.0062110.776373125 0
WorkerNode.bind_port0.0350300.0460820.052469
0.0582930.0603110.04597311.493259   250 0
WorkerNode.ping_port0.0050570.0067271.047692
1.0692531.0713360.26689666.724094   250 0
---

The results with the present main [2] are:

---
Min (s) Median (s)  90%ile (s)  99%ile 
(s)  Max (s) Mean (s)Total (s)   Count   Failed
---
Iteration Total 0.1354912.2238053.311270
3.3390783.3453461.729172216.146495  125 0
Namespace.add_ports 0.0053800.0057440.006819
0.0187730.0208000.0062920.786532125 0
WorkerNode.bind_port0.0341790.0460550.053488
0.0588010.0710430.04611711.529311   250 0
WorkerNode.ping_port0.0049560.0069523.086952
3.1917433.1928070.791544197.886026  250 0
---

[1] - 
https://github.com/ovn-org/ovn-heater/blob/main/test-scenarios/ocp-500-density-heavy.yml
[2] - 2a12cda890a7("controller, northd: Wait for cleanup before replying to 
exit")

Signed-off-by: Numan Siddique 
---
 northd/en-sync-sb.c  | 505 +--
 northd/inc-proc-northd.c |   1 +
 northd/lflow-mgr.c   | 196 ++-
 northd/lflow-mgr.h   |  23 +-
 northd/northd.c  | 238 --
 northd/northd.h  |   6 -
 tests/ovn-northd.at  | 164 ++---
 7 files changed, 705 insertions(+), 428 deletions(-)

diff --git a/northd/en-sync-sb.c b/northd/en-sync-sb.c
index d39cbbf2e6..80f3621bb9 100644
--- a/northd/en-sync-sb.c
+++ b/northd/en-sync-sb.c
@@ -18,17 +18,21 @@
 #include 
 #include 
 
+/* OVS includes. */
 #include "lib/svec.h"
 #include "openvswitch/util.h"
 
+/* OVN includes. */
 #include "en-lr-nat.h"
 #include "en-lr-stateful.h"
 #include "en-sync-sb.h"
+#include "lb.h"
 #include "lib/inc-proc-eng.h"
 #include "lib/lb.h"
 #include "lib/ovn-nb-idl.h"
 #include "lib/ovn-sb-idl.h"
 #include "lib/ovn-util.h"
+#include "lflow-mgr.h"
 #include "northd.h"
 
 #include "openvswitch/vlog.h"
@@ -51,6 +55,40 @@ static void build_port_group_address_set(const struct 
nbrec_port_group *,
  struct svec *ipv4_addrs,
  struct svec *ipv6_addrs);
 
+struct sb_lb_table;
+struct sb_lb_record;
+static void sb_lb_table_init(struct sb_lb_table *);
+static void sb_lb_table_clear(struct sb_lb_table *);
+static void sb_lb_table_destroy(struct sb_lb_table *);
+
+static struct sb_lb_record *sb_lb_table_find(struct hmap *sb_lbs,
+ const struct uuid *);
+static void sb_lb_table_build_and_sync(struct sb_lb_table *,
+struct ovsdb_idl_txn *ovnsb_txn,
+const struct sbrec_load_balancer_table *,
+const struct sbrec_logical_dp_group_table *,
+struct hmap *lb_dps_map,
+