This adds a convenience macro that defines the priority, match, and action for a default drop.
We use this macro to convert all instances of ovn_lflow_add_default_drop() to ovn_lflow_add(). Signed-off-by: Mark Michelson <[email protected]> --- northd/lflow-mgr.h | 11 ++++++----- northd/northd.c | 27 +++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/northd/lflow-mgr.h b/northd/lflow-mgr.h index b0afa5349..fdff24445 100644 --- a/northd/lflow-mgr.h +++ b/northd/lflow-mgr.h @@ -121,6 +121,7 @@ void lflow_table_add_lflow(struct lflow_table *, const struct ovn_datapath *, */ #define WITH_IO_PORT(IO_PORT) .io_port = IO_PORT #define WITH_CTRL_METER(CTRL_METER) .ctrl_meter = CTRL_METER +#define WITH_DESC(FLOW_DESC) .flow_desc = FLOW_DESC #define ovn_lflow_add_10(LFLOW_TABLE, OD, STAGE, PRIORITY, MATCH, ACTIONS, \ LFLOW_REF, ARG8, ARG9, ARG10) \ @@ -177,13 +178,13 @@ void lflow_table_add_lflow(struct lflow_table *, const struct ovn_datapath *, }, OVS_SOURCE_LOCATOR) /* Adds a row with the specified contents to the Logical_Flow table. */ -#define ovn_lflow_add_default_drop(LFLOW_TABLE, OD, STAGE, LFLOW_REF) \ - lflow_table_add_lflow(LFLOW_TABLE, OD, NULL, 0, STAGE, 0, "1", \ - debug_drop_action(), NULL, NULL, NULL, \ - OVS_SOURCE_LOCATOR, NULL, LFLOW_REF) - #define ovn_lflow_add(...) VFUNC(ovn_lflow_add_, __VA_ARGS__) +/* Use this as a stand-in for the priority, match, and action when adding + * a default drop action to a stage. + */ +#define DEFAULT_DROP 0, "1", debug_drop_action() + #define ovn_lflow_add_drop_with_desc(LFLOW_TABLE, OD, STAGE, PRIORITY, MATCH, \ DESCRIPTION, LFLOW_REF) \ lflow_table_add_lflow(LFLOW_TABLE, OD, NULL, 0, STAGE, PRIORITY, MATCH, \ diff --git a/northd/northd.c b/northd/northd.c index ecbad180c..81d5fbd31 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -13985,8 +13985,7 @@ build_adm_ctrl_flows_for_lrouter( lflow_ref); /* Default action for L2 security is to drop. */ - ovn_lflow_add_default_drop(lflows, od, S_ROUTER_IN_ADMISSION, - lflow_ref); + ovn_lflow_add(lflows, od, S_ROUTER_IN_ADMISSION, DEFAULT_DROP, lflow_ref); } static int @@ -14289,8 +14288,8 @@ build_neigh_learning_flows_for_lrouter( od->nbr->copp, meter_groups))); - ovn_lflow_add_default_drop(lflows, od, S_ROUTER_IN_LEARN_NEIGHBOR, - lflow_ref); + ovn_lflow_add(lflows, od, S_ROUTER_IN_LEARN_NEIGHBOR, DEFAULT_DROP, + lflow_ref); } /* Logical router ingress Table 1: Neighbor lookup lflows @@ -14514,10 +14513,10 @@ build_default_route_flows_for_lrouter( struct ovn_datapath *od, struct lflow_table *lflows, struct simap *route_tables) { - ovn_lflow_add_default_drop(lflows, od, S_ROUTER_IN_IP_ROUTING_ECMP, - od->datapath_lflows); - ovn_lflow_add_default_drop(lflows, od, S_ROUTER_IN_IP_ROUTING, - od->datapath_lflows); + ovn_lflow_add(lflows, od, S_ROUTER_IN_IP_ROUTING_ECMP, DEFAULT_DROP, + od->datapath_lflows); + ovn_lflow_add(lflows, od, S_ROUTER_IN_IP_ROUTING, DEFAULT_DROP, + od->datapath_lflows); ovn_lflow_add(lflows, od, S_ROUTER_IN_IP_ROUTING_ECMP, 150, REG_ECMP_GROUP_ID" == 0", "next;", od->datapath_lflows); @@ -14918,8 +14917,8 @@ build_ingress_policy_flows_for_lrouter( ovn_lflow_add(lflows, od, S_ROUTER_IN_POLICY_ECMP, 150, REG_ECMP_GROUP_ID" == 0", "next;", lflow_ref); - ovn_lflow_add_default_drop(lflows, od, S_ROUTER_IN_POLICY_ECMP, - lflow_ref); + ovn_lflow_add(lflows, od, S_ROUTER_IN_POLICY_ECMP, DEFAULT_DROP, + lflow_ref); /* Convert routing policies to flows. */ uint16_t ecmp_group_id = 1; @@ -14964,8 +14963,8 @@ build_arp_resolve_flows_for_lrouter( "get_nd(outport, " REG_NEXT_HOP_IPV6 "); next;", lflow_ref); - ovn_lflow_add_default_drop(lflows, od, S_ROUTER_IN_ARP_RESOLVE, - lflow_ref); + ovn_lflow_add(lflows, od, S_ROUTER_IN_ARP_RESOLVE, DEFAULT_DROP, + lflow_ref); } /* Local router ingress table ARP_RESOLVE: ARP Resolution. @@ -18877,8 +18876,8 @@ build_lswitch_and_lrouter_iterate_by_lr(struct ovn_datapath *od, /* Default drop rule in lr_out_delivery stage. See * build_egress_delivery_flows_for_lrouter_port() which adds a rule * for each router port. */ - ovn_lflow_add_default_drop(lsi->lflows, od, S_ROUTER_OUT_DELIVERY, - od->datapath_lflows); + ovn_lflow_add(lsi->lflows, od, S_ROUTER_OUT_DELIVERY, DEFAULT_DROP, + od->datapath_lflows); } /* Helper function to combine all lflow generation which is iterated by logical -- 2.51.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
