COMPREPLY=( $( compgen -W "action" -- "$cur" ) )
;;
$((7 + $i)))
- COMPREPLY=( $( compgen -W "trap drop" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "trap drop mirror" -- "$cur" ) )
;;
esac
}
case $prev in
action)
- COMPREPLY=( $( compgen -W "trap drop" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "trap drop mirror" -- "$cur" ) )
return
;;
policer)
*p_action = DEVLINK_TRAP_ACTION_DROP;
} else if (strcmp(actionstr, "trap") == 0) {
*p_action = DEVLINK_TRAP_ACTION_TRAP;
+ } else if (strcmp(actionstr, "mirror") == 0) {
+ *p_action = DEVLINK_TRAP_ACTION_MIRROR;
} else {
pr_err("Unknown trap action \"%s\"\n", actionstr);
return -EINVAL;
return "drop";
case DEVLINK_TRAP_ACTION_TRAP:
return "trap";
+ case DEVLINK_TRAP_ACTION_MIRROR:
+ return "mirror";
default:
return "<unknown action>";
}
static void cmd_trap_help(void)
{
- pr_err("Usage: devlink trap set DEV trap TRAP [ action { trap | drop } ]\n");
+ pr_err("Usage: devlink trap set DEV trap TRAP [ action { trap | drop | mirror } ]\n");
pr_err(" devlink trap show [ DEV trap TRAP ]\n");
- pr_err(" devlink trap group set DEV group GROUP [ action { trap | drop } ]\n");
+ pr_err(" devlink trap group set DEV group GROUP [ action { trap | drop | mirror } ]\n");
pr_err(" [ policer POLICER ] [ nopolicer ]\n");
pr_err(" devlink trap group show [ DEV group GROUP ]\n");
pr_err(" devlink trap policer set DEV policer POLICER [ rate RATE ] [ burst BURST ]\n");
.ti -8
.BI "devlink trap set " DEV " trap " TRAP
-.RB "[ " action " { " trap " | " drop " } ]"
+.RB "[ " action " { " trap " | " drop " | " mirror " } ]"
.ti -8
.B "devlink trap group show"
.ti -8
.BI "devlink trap group set " DEV " group " GROUP
-.RB "[ " action " { " trap " | " drop " } ]"
+.RB "[ " action " { " trap " | " drop " | " mirror " } ]"
.br
.RB "[ " policer
.IB "POLICER " ]
- specifies the packet trap.
.TP
-.BR action " { " trap " | " drop " } "
+.BR action " { " trap " | " drop " | " mirror " } "
packet trap action.
.I trap
.I drop
- the packet is dropped by the underlying device and a copy is not sent to the CPU.
+.I mirror
+- the packet is forwarded by the underlying device and a copy is sent to the CPU.
+
.SS devlink trap group show - display available packet trap groups and their attributes
.PP
- specifies the packet trap group.
.TP
-.BR action " { " trap " | " drop " } "
+.BR action " { " trap " | " drop " | " mirror " } "
packet trap action. The action is set for all the packet traps member in the
trap group. The actions of non-drop traps cannot be changed and are thus
skipped.