/* Aging information for per port. */
struct mlx5_age_info {
uint8_t flags; /* Indicate if is new event or need to be triggered. */
- union {
- struct mlx5_counters aged_counters; /* Aged counter list. */
- struct aso_age_list aged_aso; /* Aged ASO actions list. */
- };
+ struct mlx5_counters aged_counters; /* Aged counter list. */
+ struct aso_age_list aged_aso; /* Aged ASO actions list. */
rte_spinlock_t aged_sl; /* Aged flow list lock. */
};
rw_act_num += MLX5_ACT_NUM_SET_TAG;
break;
case MLX5_RTE_FLOW_ACTION_TYPE_AGE:
+ if (!attr->group)
+ return rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+ NULL,
+ "Shared ASO age action is not supported for group 0");
action_flags |= MLX5_FLOW_ACTION_AGE;
++actions_n;
break;
action_flags |= MLX5_FLOW_ACTION_AGE;
break;
case RTE_FLOW_ACTION_TYPE_AGE:
- if (priv->sh->flow_hit_aso_en) {
+ if (priv->sh->flow_hit_aso_en && attr->group) {
flow->age = flow_dv_translate_create_aso_age
(dev, action->conf);
if (!flow->age)
(error, rte_errno,
RTE_FLOW_ERROR_TYPE_ACTION,
NULL,
- "can't create age action");
+ "can't create ASO age action");
dev_flow->dv.actions[actions_n++] =
(flow_aso_age_get_by_idx
(dev, flow->age))->dr_action;
NULL, "empty context");
age_info = GET_PORT_AGE_INFO(priv);
rte_spinlock_lock(&age_info->aged_sl);
- if (priv->sh->flow_hit_aso_en)
- LIST_FOREACH(act, &age_info->aged_aso, next) {
- nb_flows++;
- if (nb_contexts) {
- context[nb_flows - 1] =
- act->age_params.context;
- if (!(--nb_contexts))
- break;
- }
+ LIST_FOREACH(act, &age_info->aged_aso, next) {
+ nb_flows++;
+ if (nb_contexts) {
+ context[nb_flows - 1] =
+ act->age_params.context;
+ if (!(--nb_contexts))
+ break;
}
- else
- TAILQ_FOREACH(counter, &age_info->aged_counters, next) {
- nb_flows++;
- if (nb_contexts) {
- age_param = MLX5_CNT_TO_AGE(counter);
- context[nb_flows - 1] = age_param->context;
- if (!(--nb_contexts))
- break;
- }
+ }
+ TAILQ_FOREACH(counter, &age_info->aged_counters, next) {
+ nb_flows++;
+ if (nb_contexts) {
+ age_param = MLX5_CNT_TO_AGE(counter);
+ context[nb_flows - 1] = age_param->context;
+ if (!(--nb_contexts))
+ break;
}
+ }
rte_spinlock_unlock(&age_info->aged_sl);
MLX5_AGE_SET(age_info, MLX5_AGE_TRIGGER);
return nb_flows;