* Add a flow of copying flow metadata registers in RX_CP_TBL. * * All the flow having Q/RSS action should be split by * flow_mreg_split_qrss_prep() to pass by RX_CP_TBL. A flow in the RX_CP_TBL * performs the following, * - CQE->flow_tag := reg_c[1] (MARK) * - CQE->flow_table_metadata (reg_b) := reg_c[0] (META) * As CQE's flow_tag is not a register, it can't be simply copied from reg_c[
| 5383 | * 0 on success, negative value otherwise and rte_errno is set. |
| 5384 | */ |
| 5385 | static int |
| 5386 | flow_mreg_update_copy_table(struct rte_eth_dev *dev, |
| 5387 | struct rte_flow *flow, |
| 5388 | const struct rte_flow_action *actions, |
| 5389 | struct rte_flow_error *error) |
| 5390 | { |
| 5391 | struct mlx5_priv *priv = dev->data->dev_private; |
| 5392 | struct mlx5_sh_config *config = &priv->sh->config; |
| 5393 | struct mlx5_flow_mreg_copy_resource *mcp_res; |
| 5394 | const struct rte_flow_action_mark *mark; |
| 5395 | |
| 5396 | /* Check whether extensive metadata feature is engaged. */ |
| 5397 | if (!config->dv_flow_en || |
| 5398 | config->dv_xmeta_en == MLX5_XMETA_MODE_LEGACY || |
| 5399 | !mlx5_flow_ext_mreg_supported(dev) || |
| 5400 | !priv->sh->dv_regc0_mask) |
| 5401 | return 0; |
| 5402 | /* Find MARK action. */ |
| 5403 | for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { |
| 5404 | switch (actions->type) { |
| 5405 | case RTE_FLOW_ACTION_TYPE_FLAG: |
| 5406 | mcp_res = flow_mreg_add_copy_action |
| 5407 | (dev, MLX5_FLOW_MARK_DEFAULT, error); |
| 5408 | if (!mcp_res) |
| 5409 | return -rte_errno; |
| 5410 | flow->rix_mreg_copy = mcp_res->idx; |
| 5411 | return 0; |
| 5412 | case RTE_FLOW_ACTION_TYPE_MARK: |
| 5413 | mark = (const struct rte_flow_action_mark *) |
| 5414 | actions->conf; |
| 5415 | mcp_res = |
| 5416 | flow_mreg_add_copy_action(dev, mark->id, error); |
| 5417 | if (!mcp_res) |
| 5418 | return -rte_errno; |
| 5419 | flow->rix_mreg_copy = mcp_res->idx; |
| 5420 | return 0; |
| 5421 | default: |
| 5422 | break; |
| 5423 | } |
| 5424 | } |
| 5425 | return 0; |
| 5426 | } |
| 5427 | |
| 5428 | #define MLX5_MAX_SPLIT_ACTIONS 24 |
| 5429 | #define MLX5_MAX_SPLIT_ITEMS 24 |
no test coverage detected