@@ -14,11 +14,13 @@
#include "spectrum.h"
#include "core_acl_flex_keys.h"
-static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
- struct mlxsw_sp_acl_block *block,
- struct mlxsw_sp_acl_rule_info *rulei,
- struct flow_action *flow_action,
- struct netlink_ext_ack *extack)
+static int
+mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
+ struct mlxsw_sp_acl_block *block,
+ struct mlxsw_sp_acl_rule_info *rulei,
+ struct flow_action *flow_action,
+ enum flow_cls_hw_stats_type hw_stats_type,
+ struct netlink_ext_ack *extack)
{
const struct flow_action_entry *act;
int mirror_act_count = 0;
@@ -27,10 +29,17 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
if (!flow_action_has_entries(flow_action))
return 0;
- /* Count action is inserted first */
- err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
- if (err)
- return err;
+ switch (hw_stats_type) {
+ case FLOW_CLS_HW_STATS_TYPE_ANY:
+ /* Count action is inserted first */
+ err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
+ if (err)
+ return err;
+ break;
+ default:
+ NL_SET_ERR_MSG_MOD(extack, "Unsupported HW stats type");
+ return -EOPNOTSUPP;
+ }
flow_action_for_each(i, act, flow_action) {
switch (act->id) {
@@ -449,6 +458,7 @@ static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp,
return mlxsw_sp_flower_parse_actions(mlxsw_sp, block, rulei,
&f->rule->action,
+ f->common.hw_stats_type,
f->common.extack);
}