diff options
author | Nir Dotan <nird@mellanox.com> | 2018-12-10 07:11:41 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-11 23:01:33 -0800 |
commit | 2507a64c17e646800025dfeb508d5c406bf24ec4 (patch) | |
tree | 4bdd55dbf804ab0c41f41093ab1749ffe1a89588 /drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c | |
parent | 1a29d29394c79648928f4a2b82cf2fafc460dc55 (diff) | |
download | linux-stable-2507a64c17e646800025dfeb508d5c406bf24ec4.tar.gz linux-stable-2507a64c17e646800025dfeb508d5c406bf24ec4.tar.bz2 linux-stable-2507a64c17e646800025dfeb508d5c406bf24ec4.zip |
mlxsw: spectrum_acl: Add replace rule action operation
Multicast routes actions may be updated after creation. An example for that
is an addition of an egress interface to an existing route.
So far, as tc flower API dictated, ACL rules were either created or
deleted. Since multicast routes in Spectrum-2 are written to ACL as any
rule, it is required to allow the update of a rule's action as it may
change.
Add methods and operations to support updating rule's action. This is
supported only for Spectrum-2.
Signed-off-by: Nir Dotan <nird@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c index c4f9238591e6..44bbe7c9b68c 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c @@ -721,6 +721,21 @@ void mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp, ops->rule_del(mlxsw_sp, rule->priv); } +int mlxsw_sp_acl_rule_action_replace(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_rule *rule, + struct mlxsw_afa_block *afa_block) +{ + struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; + const struct mlxsw_sp_acl_profile_ops *ops = ruleset->ht_key.ops; + struct mlxsw_sp_acl_rule_info *rulei; + + rulei = mlxsw_sp_acl_rule_rulei(rule); + rulei->act_block = afa_block; + + return ops->rule_action_replace(mlxsw_sp, ruleset->priv, rule->priv, + rule->rulei); +} + struct mlxsw_sp_acl_rule * mlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_ruleset *ruleset, |