mlxsw: spectrum: mr_tcam: Add trap-and-forward multicast route
In addition to the current multicast route actions, which include trap route action and a forward route action, add the trap-and-forward multicast route action, and implement it in the multicast routing hardware logic. To implement that, add a trap-and-forward ACL action as the last action in the route flexible action set. The used trap is the ACL2 trap, which marks the packets with offload_mr_forward_mark, to prevent the packet from being forwarded again by the kernel. Note: At that stage the offloading logic does not support trap-and-forward multicast routes. This patch adds the support only in the hardware logic. 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
a0040c8c93
commit
607feadef8
|
@ -42,6 +42,7 @@
|
||||||
enum mlxsw_sp_mr_route_action {
|
enum mlxsw_sp_mr_route_action {
|
||||||
MLXSW_SP_MR_ROUTE_ACTION_FORWARD,
|
MLXSW_SP_MR_ROUTE_ACTION_FORWARD,
|
||||||
MLXSW_SP_MR_ROUTE_ACTION_TRAP,
|
MLXSW_SP_MR_ROUTE_ACTION_TRAP,
|
||||||
|
MLXSW_SP_MR_ROUTE_ACTION_TRAP_AND_FORWARD,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum mlxsw_sp_mr_route_prio {
|
enum mlxsw_sp_mr_route_prio {
|
||||||
|
|
|
@ -253,6 +253,7 @@ mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp,
|
||||||
if (err)
|
if (err)
|
||||||
goto err;
|
goto err;
|
||||||
break;
|
break;
|
||||||
|
case MLXSW_SP_MR_ROUTE_ACTION_TRAP_AND_FORWARD:
|
||||||
case MLXSW_SP_MR_ROUTE_ACTION_FORWARD:
|
case MLXSW_SP_MR_ROUTE_ACTION_FORWARD:
|
||||||
/* If we are about to append a multicast router action, commit
|
/* If we are about to append a multicast router action, commit
|
||||||
* the erif_list.
|
* the erif_list.
|
||||||
|
@ -266,6 +267,13 @@ mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp,
|
||||||
erif_list->kvdl_index);
|
erif_list->kvdl_index);
|
||||||
if (err)
|
if (err)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
if (route_action == MLXSW_SP_MR_ROUTE_ACTION_TRAP_AND_FORWARD) {
|
||||||
|
err = mlxsw_afa_block_append_trap_and_forward(afa_block,
|
||||||
|
MLXSW_TRAP_ID_ACL2);
|
||||||
|
if (err)
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue