|
@@ -293,6 +293,9 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
|
|
}
|
|
}
|
|
|
|
|
|
if (fte->action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
|
|
if (fte->action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
|
|
|
|
+ int max_list_size = BIT(MLX5_CAP_FLOWTABLE_TYPE(dev,
|
|
|
|
+ log_max_flow_counter,
|
|
|
|
+ ft->type));
|
|
int list_size = 0;
|
|
int list_size = 0;
|
|
|
|
|
|
list_for_each_entry(dst, &fte->node.children, node.list) {
|
|
list_for_each_entry(dst, &fte->node.children, node.list) {
|
|
@@ -305,12 +308,17 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
|
|
in_dests += MLX5_ST_SZ_BYTES(dest_format_struct);
|
|
in_dests += MLX5_ST_SZ_BYTES(dest_format_struct);
|
|
list_size++;
|
|
list_size++;
|
|
}
|
|
}
|
|
|
|
+ if (list_size > max_list_size) {
|
|
|
|
+ err = -EINVAL;
|
|
|
|
+ goto err_out;
|
|
|
|
+ }
|
|
|
|
|
|
MLX5_SET(flow_context, in_flow_context, flow_counter_list_size,
|
|
MLX5_SET(flow_context, in_flow_context, flow_counter_list_size,
|
|
list_size);
|
|
list_size);
|
|
}
|
|
}
|
|
|
|
|
|
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
|
|
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
|
|
|
|
+err_out:
|
|
kvfree(in);
|
|
kvfree(in);
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|