[PATCH net mlxsw v2 4/4] mlxsw: core_acl_flex_actions: Remove redundant mirror resource destruction

Nir Dotan nird at mellanox.com
Wed Aug 1 00:43:59 AEST 2018

In previous patch a dupliacte destruction was avoided with adding
mlxsw_afa_resource_del() in order to remove a destroyed resource in order
to avoid a duplicate detruction scenario.
For mirror actions such duplicate destruction leads to a crash as in:

 # tc qdisc add dev swp49 ingress
 # tc filter add dev swp49 parent ffff: \
   protocol ip chain 100 pref 10 flower \
   skip_sw dst_ip action drop
 # tc filter add dev swp49 parent ffff: \
   protocol ip pref 10 flower \
   skip_sw dst_ip action goto chain 100 \
   action mirred egress mirror dev swp4

Therefore add a call to mlxsw_afa_resource_del() in
mlxsw_afa_mirror_destroy() in order to clear that resource
from rule's resources.

Fixes: d0d13c1858a1 ("mlxsw: spectrum_acl: Add support for mirror action")
Signed-off-by: Nir Dotan <nird at mellanox.com>

    * Split this patch from patch #2

 drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
index a54f23f..f6f6a56 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
@@ -862,6 +862,7 @@ static void
 mlxsw_afa_mirror_destroy(struct mlxsw_afa_block *block,
 			 struct mlxsw_afa_mirror *mirror)
+	mlxsw_afa_resource_del(&mirror->resource);

More information about the Linux-mlxsw mailing list