@@ -133,6 +133,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 LFLOW_TABLE_ADD_ARGS_END }
@@ -154,12 +155,6 @@ void lflow_table_add_lflow(struct lflow_table *, const struct ovn_datapath *,
LFLOW_TABLE_ADD_ARGS_END \
)
-#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, \
- debug_drop_action(), NULL, NULL, NULL, \
- OVS_SOURCE_LOCATOR, DESCRIPTION, LFLOW_REF)
-
#define ovn_lflow_add_drop_with_lport_hint_and_desc(LFLOW_TABLE, OD, STAGE, \
PRIORITY, MATCH, \
IN_OUT_PORT, STAGE_HINT, \
@@ -6080,10 +6080,10 @@ build_lswitch_output_port_sec_od(struct ovn_datapath *od,
REGBIT_PORT_SEC_DROP" = check_out_port_sec(); next;",
lflow_ref);
- ovn_lflow_add_drop_with_desc(
+ ovn_lflow_add(
lflows, od, S_SWITCH_OUT_APPLY_PORT_SEC, 50,
- REGBIT_PORT_SEC_DROP" == 1",
- "Packet does not follow port security rules", lflow_ref);
+ REGBIT_PORT_SEC_DROP" == 1", debug_drop_action(), lflow_ref,
+ WITH_DESC("Packet does not follow port security rules"));
ovn_lflow_add(lflows, od, S_SWITCH_OUT_APPLY_PORT_SEC, 0,
"1", "output;", lflow_ref);
}
@@ -9855,9 +9855,11 @@ build_lswitch_lflows_evpn_l2_unknown(struct ovn_datapath *od,
"outport == \"none\" && remote_outport == \"none\"",
"outport = \""MC_UNKNOWN "\"; output;", lflow_ref);
} else {
- ovn_lflow_add_drop_with_desc(
+ ovn_lflow_add(
lflows, od, S_SWITCH_IN_L2_UNKNOWN, 50, "outport == \"none\" && "
- "remote_outport == \"none\"", "No L2 destination", lflow_ref);
+ "remote_outport == \"none\"", debug_drop_action(),
+ lflow_ref,
+ WITH_DESC("No L2 destination"));
}
if (smap_get_bool(&od->nbs->other_config,
@@ -9887,9 +9889,10 @@ build_lswitch_lflows_l2_unknown(struct ovn_datapath *od,
"outport = \""MC_UNKNOWN "\"; output;",
lflow_ref);
} else {
- ovn_lflow_add_drop_with_desc(
+ ovn_lflow_add(
lflows, od, S_SWITCH_IN_L2_UNKNOWN, 50, "outport == \"none\"",
- "No L2 destination", lflow_ref);
+ debug_drop_action(), lflow_ref,
+ WITH_DESC("No L2 destination"));
}
ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_UNKNOWN, 0, "1",
"output;", lflow_ref);
@@ -9925,36 +9928,36 @@ build_lswitch_lflows_admission_control(struct ovn_datapath *od,
ovs_assert(od->nbs);
/* Default action for recirculated ICMP error 'packet too big'. */
- ovn_lflow_add_drop_with_desc(
+ ovn_lflow_add(
lflows, od, S_SWITCH_IN_CHECK_PORT_SEC, 105,
"((ip4 && icmp4.type == 3 && icmp4.code == 4) ||"
" (ip6 && icmp6.type == 2 && icmp6.code == 0)) &&"
- " flags.tunnel_rx == 1", "ICMP: packet too big", lflow_ref);
+ " flags.tunnel_rx == 1", debug_drop_action(), lflow_ref,
+ WITH_DESC("ICMP: packet too big"));
/* Logical VLANs not supported. */
if (!is_vlan_transparent(od)) {
/* Block logical VLANs. */
- ovn_lflow_add_drop_with_desc(
+ ovn_lflow_add(
lflows, od, S_SWITCH_IN_CHECK_PORT_SEC,
- 100, "vlan.present",
- "VLANs blocked due to vlan-passthru option",
- lflow_ref);
+ 100, "vlan.present", debug_drop_action(), lflow_ref,
+ WITH_DESC("VLANs blocked due to vlan-passthru option"));
}
/* Broadcast/multicast source address is invalid. */
- ovn_lflow_add_drop_with_desc(
+ ovn_lflow_add(
lflows, od, S_SWITCH_IN_CHECK_PORT_SEC, 100,
- "eth.src[40]", "Incoming Broadcast/multicast source"
- " address is invalid", lflow_ref);
+ "eth.src[40]", debug_drop_action(), lflow_ref,
+ WITH_DESC("Incoming Broadcast/multicast source"));
ovn_lflow_add(lflows, od, S_SWITCH_IN_CHECK_PORT_SEC, 50, "1",
REGBIT_PORT_SEC_DROP" = check_in_port_sec(); next;",
lflow_ref);
- ovn_lflow_add_drop_with_desc(
+ ovn_lflow_add(
lflows, od, S_SWITCH_IN_APPLY_PORT_SEC, 50,
- REGBIT_PORT_SEC_DROP" == 1",
- "Broadcast/multicast port security invalid", lflow_ref);
+ REGBIT_PORT_SEC_DROP" == 1", debug_drop_action(), lflow_ref,
+ WITH_DESC("Broadcast/multicast port security invalid"));
ovn_lflow_add(lflows, od, S_SWITCH_IN_APPLY_PORT_SEC, 0, "1", "next;",
lflow_ref);
This adds a WITH_DESC() macro that can be used with ovn_lflow_add() to add a drop description to a logical flow. This commit converts all uses of ovn_lflow_add_drop_with_desc() to ovn_lflow_add(). Signed-off-by: Mark Michelson <mmichels@redhat.com> --- northd/lflow-mgr.h | 7 +------ northd/northd.c | 41 ++++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 25 deletions(-)