mlxsw: acl: Introduce ACL trap and forward action
Use trap/discard flex action to implement trap and forward. The action will later be used for multicast routing, as the multicast routing mechanism is done using ACL flexible actions in Spectrum hardware. Using that action, it will be possible to implement a trap-and-forward route. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a5bc9294d7
commit
2678724355
|
@ -676,6 +676,7 @@ enum mlxsw_afa_trapdisc_trap_action {
|
|||
MLXSW_ITEM32(afa, trapdisc, trap_action, 0x00, 24, 4);
|
||||
|
||||
enum mlxsw_afa_trapdisc_forward_action {
|
||||
MLXSW_AFA_TRAPDISC_FORWARD_ACTION_FORWARD = 1,
|
||||
MLXSW_AFA_TRAPDISC_FORWARD_ACTION_DISCARD = 3,
|
||||
};
|
||||
|
||||
|
@ -729,6 +730,22 @@ int mlxsw_afa_block_append_trap(struct mlxsw_afa_block *block, u16 trap_id)
|
|||
}
|
||||
EXPORT_SYMBOL(mlxsw_afa_block_append_trap);
|
||||
|
||||
int mlxsw_afa_block_append_trap_and_forward(struct mlxsw_afa_block *block,
|
||||
u16 trap_id)
|
||||
{
|
||||
char *act = mlxsw_afa_block_append_action(block,
|
||||
MLXSW_AFA_TRAPDISC_CODE,
|
||||
MLXSW_AFA_TRAPDISC_SIZE);
|
||||
|
||||
if (!act)
|
||||
return -ENOBUFS;
|
||||
mlxsw_afa_trapdisc_pack(act, MLXSW_AFA_TRAPDISC_TRAP_ACTION_TRAP,
|
||||
MLXSW_AFA_TRAPDISC_FORWARD_ACTION_FORWARD,
|
||||
trap_id);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(mlxsw_afa_block_append_trap_and_forward);
|
||||
|
||||
/* Forwarding Action
|
||||
* -----------------
|
||||
* Forwarding Action can be used to implement Policy Based Switching (PBS)
|
||||
|
|
|
@ -61,6 +61,8 @@ int mlxsw_afa_block_continue(struct mlxsw_afa_block *block);
|
|||
int mlxsw_afa_block_jump(struct mlxsw_afa_block *block, u16 group_id);
|
||||
int mlxsw_afa_block_append_drop(struct mlxsw_afa_block *block);
|
||||
int mlxsw_afa_block_append_trap(struct mlxsw_afa_block *block, u16 trap_id);
|
||||
int mlxsw_afa_block_append_trap_and_forward(struct mlxsw_afa_block *block,
|
||||
u16 trap_id);
|
||||
int mlxsw_afa_block_append_fwd(struct mlxsw_afa_block *block,
|
||||
u8 local_port, bool in_port);
|
||||
int mlxsw_afa_block_append_vlan_modify(struct mlxsw_afa_block *block,
|
||||
|
|
Loading…
Reference in New Issue