devlink: Add 'mirror' trap action

The action is used by control traps such as IGMP query. The packet is
flooded by the device, but also trapped to the CPU in order for the
software bridge to mark the receiving port as a multicast router port.
Such packets are marked with 'skb->offload_fwd_mark = 1' in order to
prevent the software bridge from flooding them again.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ido Schimmel
2020-05-29 21:36:39 +03:00
committed by David S. Miller
parent 85176f19f5
commit 9eefeabed6
3 changed files with 7 additions and 1 deletions

View File

@@ -5869,7 +5869,8 @@ devlink_trap_action_get_from_info(struct genl_info *info,
val = nla_get_u8(info->attrs[DEVLINK_ATTR_TRAP_ACTION]);
switch (val) {
case DEVLINK_TRAP_ACTION_DROP: /* fall-through */
case DEVLINK_TRAP_ACTION_TRAP:
case DEVLINK_TRAP_ACTION_TRAP: /* fall-through */
case DEVLINK_TRAP_ACTION_MIRROR:
*p_trap_action = val;
break;
default: