From: Anton Ivanov <[email protected]> Move pre-acl and acl processing in build_lswitch_flows() into a separate helper function
Signed-off-by: Anton Ivanov <[email protected]> --- northd/ovn-northd.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 355d539da..a6212f902 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -6736,6 +6736,13 @@ build_drop_arp_nd_flows_for_unbound_router_ports(struct ovn_port *op, ds_destroy(&match); } +/* Build pre-ACL and ACL tables for both ingress and egress. + * Ingress tables 3 through 10. Egress tables 0 through 7. */ +static void +build_lswitch_flows_pre_acl_and_acl(struct ovn_datapath *od, + struct hmap *lflows, struct hmap *port_groups, + struct shash *meter_groups, struct hmap *lbs); + /* * Do not remove this comment - it is here as a marker to * make diffs readable. @@ -6758,18 +6765,8 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports, * Ingress tables 3 through 10. Egress tables 0 through 7. */ struct ovn_datapath *od; HMAP_FOR_EACH (od, key_node, datapaths) { - if (!od->nbs) { - continue; - } - - build_pre_acls(od, lflows); - build_pre_lb(od, lflows, meter_groups, lbs); - build_pre_stateful(od, lflows); - build_acl_hints(od, lflows); - build_acls(od, lflows, port_groups); - build_qos(od, lflows); - build_lb(od, lflows); - build_stateful(od, lflows, lbs); + build_lswitch_flows_pre_acl_and_acl(od, lflows, + port_groups, meter_groups, lbs); } /* Build logical flows for the forwarding groups */ @@ -7447,6 +7444,23 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports, ds_destroy(&actions); } +static void +build_lswitch_flows_pre_acl_and_acl(struct ovn_datapath *od, + struct hmap *lflows, struct hmap *port_groups, + struct shash *meter_groups, struct hmap *lbs) +{ + if (od->nbs) { + build_pre_acls(od, lflows); + build_pre_lb(od, lflows, meter_groups, lbs); + build_pre_stateful(od, lflows); + build_acl_hints(od, lflows); + build_acls(od, lflows, port_groups); + build_qos(od, lflows); + build_lb(od, lflows); + build_stateful(od, lflows, lbs); + } +} + /* Returns a string of the IP address of the router port 'op' that * overlaps with 'ip_s". If one is not found, returns NULL. * -- 2.20.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
