* The splitting for metadata feature. * * - Q/RSS action on NIC Rx should be split in order to pass by * the mreg copy table (RX_CP_TBL) and then it jumps to the * action table (RX_ACT_TBL) which has the split Q/RSS action. * * - All the actions on NIC Tx should have a mreg copy action to * copy reg_a from WQE to reg_c[0]. * * @param dev * Pointer to Ethernet device. * @param[in
| 6615 | * 0 on success, negative value otherwise |
| 6616 | */ |
| 6617 | static int |
| 6618 | flow_create_split_metadata(struct rte_eth_dev *dev, |
| 6619 | struct rte_flow *flow, |
| 6620 | const struct rte_flow_attr *attr, |
| 6621 | const struct rte_flow_item items[], |
| 6622 | const struct rte_flow_action actions[], |
| 6623 | struct mlx5_flow_split_info *flow_split_info, |
| 6624 | struct rte_flow_error *error) |
| 6625 | { |
| 6626 | struct mlx5_priv *priv = dev->data->dev_private; |
| 6627 | struct mlx5_sh_config *config = &priv->sh->config; |
| 6628 | const struct rte_flow_action *qrss = NULL; |
| 6629 | struct rte_flow_action *ext_actions = NULL; |
| 6630 | struct mlx5_flow *dev_flow = NULL; |
| 6631 | uint32_t qrss_id = 0; |
| 6632 | int mtr_sfx = 0; |
| 6633 | size_t act_size; |
| 6634 | int actions_n; |
| 6635 | int encap_idx; |
| 6636 | int ret; |
| 6637 | |
| 6638 | /* Check whether extensive metadata feature is engaged. */ |
| 6639 | if (!config->dv_flow_en || |
| 6640 | config->dv_xmeta_en == MLX5_XMETA_MODE_LEGACY || |
| 6641 | !mlx5_flow_ext_mreg_supported(dev)) |
| 6642 | return flow_create_split_inner(dev, flow, NULL, attr, items, |
| 6643 | actions, flow_split_info, error); |
| 6644 | actions_n = flow_parse_metadata_split_actions_info(actions, &qrss, |
| 6645 | &encap_idx); |
| 6646 | if (qrss) { |
| 6647 | /* Exclude hairpin flows from splitting. */ |
| 6648 | if (qrss->type == RTE_FLOW_ACTION_TYPE_QUEUE) { |
| 6649 | const struct rte_flow_action_queue *queue; |
| 6650 | |
| 6651 | queue = qrss->conf; |
| 6652 | if (mlx5_rxq_is_hairpin(dev, queue->index)) |
| 6653 | qrss = NULL; |
| 6654 | } else if (qrss->type == RTE_FLOW_ACTION_TYPE_RSS) { |
| 6655 | const struct rte_flow_action_rss *rss; |
| 6656 | |
| 6657 | rss = qrss->conf; |
| 6658 | if (mlx5_rxq_is_hairpin(dev, rss->queue[0])) |
| 6659 | qrss = NULL; |
| 6660 | } |
| 6661 | } |
| 6662 | if (qrss) { |
| 6663 | /* Check if it is in meter suffix table. */ |
| 6664 | mtr_sfx = attr->group == |
| 6665 | ((attr->transfer && priv->fdb_def_rule) ? |
| 6666 | (MLX5_FLOW_TABLE_LEVEL_METER - 1) : |
| 6667 | MLX5_FLOW_TABLE_LEVEL_METER); |
| 6668 | /* |
| 6669 | * Q/RSS action on NIC Rx should be split in order to pass by |
| 6670 | * the mreg copy table (RX_CP_TBL) and then it jumps to the |
| 6671 | * action table (RX_ACT_TBL) which has the split Q/RSS action. |
| 6672 | */ |
| 6673 | act_size = sizeof(struct rte_flow_action) * (actions_n + 1) + |
| 6674 | sizeof(struct rte_flow_action_set_tag) + |
no test coverage detected