cache_resource = container_of(entry,
struct mlx5_flow_dv_encap_decap_resource,
entry);
- if (resource->entry.key == cache_resource->entry.key &&
- resource->reformat_type == cache_resource->reformat_type &&
+ if (resource->reformat_type == cache_resource->reformat_type &&
resource->ft_type == cache_resource->ft_type &&
resource->flags == cache_resource->flags &&
resource->size == cache_resource->size &&
.error = error,
.data = resource,
};
+ uint64_t key64;
resource->flags = dev_flow->dv.group ? 0 : 1;
- resource->entry.key = __rte_raw_cksum(&encap_decap_key.v32,
- sizeof(encap_decap_key.v32), 0);
+ key64 = __rte_raw_cksum(&encap_decap_key.v32,
+ sizeof(encap_decap_key.v32), 0);
if (resource->reformat_type !=
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2 &&
resource->size)
- resource->entry.key = __rte_raw_cksum(resource->buf,
- resource->size,
- resource->entry.key);
- entry = mlx5_hlist_register(sh->encaps_decaps, resource->entry.key,
- &ctx);
+ key64 = __rte_raw_cksum(resource->buf, resource->size, key64);
+ entry = mlx5_hlist_register(sh->encaps_decaps, key64, &ctx);
if (!entry)
return -rte_errno;
resource = container_of(entry, typeof(*resource), entry);
.error = error,
.data = resource,
};
+ uint64_t key64;
resource->flags = dev_flow->dv.group ? 0 :
MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;
return rte_flow_error_set(error, EOVERFLOW,
RTE_FLOW_ERROR_TYPE_ACTION, NULL,
"too many modify header items");
- resource->entry.key = __rte_raw_cksum(&resource->ft_type, key_len, 0);
- entry = mlx5_hlist_register(sh->modify_cmds, resource->entry.key, &ctx);
+ key64 = __rte_raw_cksum(&resource->ft_type, key_len, 0);
+ entry = mlx5_hlist_register(sh->modify_cmds, key64, &ctx);
if (!entry)
return -rte_errno;
resource = container_of(entry, typeof(*resource), entry);
} else {
tunnel = NULL;
}
+ if (tunnel && priv->representor)
+ return rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "decap not supported "
+ "for VF representor");
grp_info.std_tbl_fix = tunnel_use_standard_attr_group_translate
(dev, tunnel, attr, items, actions);
ret = flow_dv_validate_attributes(dev, tunnel, attr, &grp_info, error);
rw_act_num += MLX5_ACT_NUM_SET_TAG;
break;
case MLX5_RTE_FLOW_ACTION_TYPE_AGE:
- if (!attr->group)
+ if (!attr->transfer && !attr->group)
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,
"not enough memory to create flow handle");
return NULL;
}
- MLX5_ASSERT(wks->flow_idx + 1 < RTE_DIM(wks->flows));
+ MLX5_ASSERT(wks->flow_idx < RTE_DIM(wks->flows));
dev_flow = &wks->flows[wks->flow_idx++];
+ memset(dev_flow, 0, sizeof(*dev_flow));
dev_flow->handle = dev_handle;
dev_flow->handle_idx = handle_idx;
/*
*/
dev_flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param) -
MLX5_ST_SZ_BYTES(fte_match_set_misc4);
- /*
- * The matching value needs to be cleared to 0 before using. In the
- * past, it will be automatically cleared when using rte_*alloc
- * API. The time consumption will be almost the same as before.
- */
- memset(dev_flow->dv.value.buf, 0, MLX5_ST_SZ_BYTES(fte_match_param));
dev_flow->ingress = attr->ingress;
dev_flow->dv.transfer = attr->transfer;
return dev_flow;
tbl_data->idx = idx;
tbl_data->tunnel = tt_prm->tunnel;
tbl_data->group_id = tt_prm->group_id;
- tbl_data->external = tt_prm->external;
+ tbl_data->external = !!tt_prm->external;
tbl_data->tunnel_offload = is_tunnel_offload_active(dev);
tbl_data->is_egress = !!key.direction;
+ tbl_data->is_transfer = !!key.domain;
+ tbl_data->dummy = !!key.dummy;
+ tbl_data->table_id = key.table_id;
tbl = &tbl_data->tbl;
if (key.dummy)
return &tbl_data->entry;
return &tbl_data->entry;
}
+int
+flow_dv_tbl_match_cb(struct mlx5_hlist *list __rte_unused,
+ struct mlx5_hlist_entry *entry, uint64_t key64,
+ void *cb_ctx __rte_unused)
+{
+ struct mlx5_flow_tbl_data_entry *tbl_data =
+ container_of(entry, struct mlx5_flow_tbl_data_entry, entry);
+ union mlx5_flow_tbl_key key = { .v64 = key64 };
+
+ return tbl_data->table_id != key.table_id ||
+ tbl_data->dummy != key.dummy ||
+ tbl_data->is_transfer != key.domain ||
+ tbl_data->is_egress != key.direction;
+}
+
/**
* Get a flow table.
*
tbl_data->tunnel->tunnel_id : 0,
.group = tbl_data->group_id
};
- union mlx5_flow_tbl_key table_key = {
- .v64 = entry->key
- };
- uint32_t table_id = table_key.table_id;
+ uint32_t table_id = tbl_data->table_id;
tunnel_grp_hash = tbl_data->tunnel ?
tbl_data->tunnel->groups :
return NULL;
}
entry->idx = idx;
+ entry->tag_id = key;
ret = mlx5_flow_os_create_flow_action_tag(key,
&entry->action);
if (ret) {
return &entry->entry;
}
+int
+flow_dv_tag_match_cb(struct mlx5_hlist *list __rte_unused,
+ struct mlx5_hlist_entry *entry, uint64_t key,
+ void *cb_ctx __rte_unused)
+{
+ struct mlx5_flow_dv_tag_resource *tag =
+ container_of(entry, struct mlx5_flow_dv_tag_resource, entry);
+
+ return key != tag->tag_id;
+}
+
/**
* Find existing tag resource or create and register a new one.
*
struct mlx5_priv *priv = dev->data->dev_private;
if (cache_resource->verbs_action)
- claim_zero(mlx5_glue->destroy_flow_action
+ claim_zero(mlx5_flow_os_destroy_flow_action
(cache_resource->verbs_action));
if (cache_resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB) {
if (cache_resource->default_miss)
- claim_zero(mlx5_glue->destroy_flow_action
+ claim_zero(mlx5_flow_os_destroy_flow_action
(cache_resource->default_miss));
}
if (cache_resource->normal_path_tbl)
MLX5_ASSERT(cache_resource->action);
if (cache_resource->action)
- claim_zero(mlx5_glue->destroy_flow_action
+ claim_zero(mlx5_flow_os_destroy_flow_action
(cache_resource->action));
for (; i < cache_resource->num_of_dest; i++)
flow_dv_sample_sub_actions_release(dev,