提交 c4afd0c8 编写于 作者: J Jiri Pirko 提交者: David S. Miller

mlxsw: restrict supported HW stats type to "any"

Currently don't allow actions with any other type to be inserted.
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3632f6d3
......@@ -29,10 +29,16 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
if (!flow_action_mixed_hw_stats_types_check(flow_action, extack))
return -EOPNOTSUPP;
/* Count action is inserted first */
err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
if (err)
return err;
act = flow_action_first_entry_get(flow_action);
if (act->hw_stats_type == FLOW_ACTION_HW_STATS_TYPE_ANY) {
/* Count action is inserted first */
err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack);
if (err)
return err;
} else {
NL_SET_ERR_MSG_MOD(extack, "Unsupported action HW stats type");
return -EOPNOTSUPP;
}
flow_action_for_each(i, act, flow_action) {
switch (act->id) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册