Message ID | 20210129112157.12450-2-anton.ivanov@cambridgegreys.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev,v13,1/4] ovn-libs: Add support for parallel processing | expand |
On Fri, Jan 29, 2021 at 4:52 PM <anton.ivanov@cambridgegreys.com> wrote: > > From: Anton Ivanov <anton.ivanov@cambridgegreys.com> > > The calling convention for the per-od/per-op routines is that > any data is passed as a part of the lsi struct. This way the > functions can be used in both sequential and parallel builds. > > Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> I applied this patch to master. Thanks Numan > --- > northd/ovn-northd.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c > index b2eb93835..f36640061 100644 > --- a/northd/ovn-northd.c > +++ b/northd/ovn-northd.c > @@ -11393,6 +11393,7 @@ struct lswitch_flow_build_info { > struct hmap *igmp_groups; > struct shash *meter_groups; > struct hmap *lbs; > + struct hmap *bfd_connections; > char *svc_check_match; > struct ds match; > struct ds actions; > @@ -11400,12 +11401,14 @@ struct lswitch_flow_build_info { > > /* Helper function to combine all lflow generation which is iterated by > * datapath. > + * > + * When extending the function new "work data" must be added to the lsi > + * struct, not passed as an argument. > */ > > static void > build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od, > - struct lswitch_flow_build_info *lsi, > - struct hmap *bfd_connections) > + struct lswitch_flow_build_info *lsi) > { > /* Build Logical Switch Flows. */ > build_lswitch_lflows_pre_acl_and_acl(od, lsi->port_groups, lsi->lflows, > @@ -11426,7 +11429,7 @@ build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od, > &lsi->actions); > build_ND_RA_flows_for_lrouter(od, lsi->lflows); > build_static_route_flows_for_lrouter(od, lsi->lflows, lsi->ports, > - bfd_connections); > + lsi->bfd_connections); > build_mcast_lookup_flows_for_lrouter(od, lsi->lflows, &lsi->match, > &lsi->actions); > build_ingress_policy_flows_for_lrouter(od, lsi->lflows, lsi->ports); > @@ -11509,6 +11512,7 @@ build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > .igmp_groups = igmp_groups, > .meter_groups = meter_groups, > .lbs = lbs, > + .bfd_connections = bfd_connections, > .svc_check_match = svc_check_match, > .match = DS_EMPTY_INITIALIZER, > .actions = DS_EMPTY_INITIALIZER, > @@ -11518,7 +11522,7 @@ build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > * will move here and will be reogranized by iterator type. > */ > HMAP_FOR_EACH (od, key_node, datapaths) { > - build_lswitch_and_lrouter_iterate_by_od(od, &lsi, bfd_connections); > + build_lswitch_and_lrouter_iterate_by_od(od, &lsi); > } > HMAP_FOR_EACH (op, key_node, ports) { > build_lswitch_and_lrouter_iterate_by_op(op, &lsi); > -- > 2.20.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index b2eb93835..f36640061 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -11393,6 +11393,7 @@ struct lswitch_flow_build_info { struct hmap *igmp_groups; struct shash *meter_groups; struct hmap *lbs; + struct hmap *bfd_connections; char *svc_check_match; struct ds match; struct ds actions; @@ -11400,12 +11401,14 @@ struct lswitch_flow_build_info { /* Helper function to combine all lflow generation which is iterated by * datapath. + * + * When extending the function new "work data" must be added to the lsi + * struct, not passed as an argument. */ static void build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od, - struct lswitch_flow_build_info *lsi, - struct hmap *bfd_connections) + struct lswitch_flow_build_info *lsi) { /* Build Logical Switch Flows. */ build_lswitch_lflows_pre_acl_and_acl(od, lsi->port_groups, lsi->lflows, @@ -11426,7 +11429,7 @@ build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od, &lsi->actions); build_ND_RA_flows_for_lrouter(od, lsi->lflows); build_static_route_flows_for_lrouter(od, lsi->lflows, lsi->ports, - bfd_connections); + lsi->bfd_connections); build_mcast_lookup_flows_for_lrouter(od, lsi->lflows, &lsi->match, &lsi->actions); build_ingress_policy_flows_for_lrouter(od, lsi->lflows, lsi->ports); @@ -11509,6 +11512,7 @@ build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports, .igmp_groups = igmp_groups, .meter_groups = meter_groups, .lbs = lbs, + .bfd_connections = bfd_connections, .svc_check_match = svc_check_match, .match = DS_EMPTY_INITIALIZER, .actions = DS_EMPTY_INITIALIZER, @@ -11518,7 +11522,7 @@ build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports, * will move here and will be reogranized by iterator type. */ HMAP_FOR_EACH (od, key_node, datapaths) { - build_lswitch_and_lrouter_iterate_by_od(od, &lsi, bfd_connections); + build_lswitch_and_lrouter_iterate_by_od(od, &lsi); } HMAP_FOR_EACH (op, key_node, ports) { build_lswitch_and_lrouter_iterate_by_op(op, &lsi);