* Create a flow and add it to @p list. * * @param dev * Pointer to Ethernet device. * @param list * Pointer to a TAILQ flow list. If this parameter NULL, * no list insertion occurred, flow is just created, * this is caller's responsibility to track the * created flow. * @param[in] attr * Flow rule attributes. * @param[in] items * Pattern specification (list terminated by
| 7338 | * A flow index on success, 0 otherwise and rte_errno is set. |
| 7339 | */ |
| 7340 | static uint32_t |
| 7341 | flow_list_create(struct rte_eth_dev *dev, enum mlx5_flow_type type, |
| 7342 | const struct rte_flow_attr *attr, |
| 7343 | const struct rte_flow_item items[], |
| 7344 | const struct rte_flow_action original_actions[], |
| 7345 | bool external, struct rte_flow_error *error) |
| 7346 | { |
| 7347 | struct mlx5_priv *priv = dev->data->dev_private; |
| 7348 | struct rte_flow *flow = NULL; |
| 7349 | struct mlx5_flow *dev_flow; |
| 7350 | const struct rte_flow_action_rss *rss = NULL; |
| 7351 | struct mlx5_translated_action_handle |
| 7352 | indir_actions[MLX5_MAX_INDIRECT_ACTIONS]; |
| 7353 | int indir_actions_n = MLX5_MAX_INDIRECT_ACTIONS; |
| 7354 | union { |
| 7355 | struct mlx5_flow_expand_rss buf; |
| 7356 | uint8_t buffer[8192]; |
| 7357 | } expand_buffer; |
| 7358 | union { |
| 7359 | struct rte_flow_action actions[MLX5_MAX_SPLIT_ACTIONS]; |
| 7360 | uint8_t buffer[2048]; |
| 7361 | } actions_rx; |
| 7362 | union { |
| 7363 | struct rte_flow_action actions[MLX5_MAX_SPLIT_ACTIONS]; |
| 7364 | uint8_t buffer[2048]; |
| 7365 | } actions_hairpin_tx; |
| 7366 | union { |
| 7367 | struct rte_flow_item items[MLX5_MAX_SPLIT_ITEMS]; |
| 7368 | uint8_t buffer[2048]; |
| 7369 | } items_tx; |
| 7370 | struct mlx5_rte_flow_item_sq sq_specs[RTE_MAX_QUEUES_PER_PORT]; |
| 7371 | struct mlx5_flow_expand_rss *buf = &expand_buffer.buf; |
| 7372 | struct mlx5_flow_rss_desc *rss_desc; |
| 7373 | const struct rte_flow_action *p_actions_rx; |
| 7374 | uint32_t i; |
| 7375 | uint32_t idx = 0; |
| 7376 | int hairpin_flow; |
| 7377 | struct rte_flow_attr attr_tx = { .priority = 0 }; |
| 7378 | const struct rte_flow_action *actions; |
| 7379 | struct rte_flow_action *translated_actions = NULL; |
| 7380 | struct mlx5_flow_tunnel *tunnel; |
| 7381 | struct tunnel_default_miss_ctx default_miss_ctx = { 0, }; |
| 7382 | struct mlx5_flow_workspace *wks = mlx5_flow_push_thread_workspace(); |
| 7383 | struct mlx5_flow_split_info flow_split_info = { |
| 7384 | .external = !!external, |
| 7385 | .skip_scale = 0, |
| 7386 | .flow_idx = 0, |
| 7387 | .prefix_mark = 0, |
| 7388 | .prefix_layers = 0, |
| 7389 | .table_id = 0 |
| 7390 | }; |
| 7391 | int ret; |
| 7392 | |
| 7393 | MLX5_ASSERT(wks); |
| 7394 | rss_desc = &wks->rss_desc; |
| 7395 | ret = flow_action_handles_translate(dev, original_actions, |
| 7396 | indir_actions, |
| 7397 | &indir_actions_n, |
no test coverage detected