* Get the sub policy of a meter. * * @param[in] dev * Pointer to Ethernet device. * @param[in] flow * Parent flow structure pointer. * @param wks * Pointer to thread flow work space. * @param[in] attr * Flow rule attributes. * @param[in] items * Pattern specification (list terminated by the END pattern item). * @param[out] error * Perform verbose error reporting if not NUL
| 5658 | * Pointer to the meter sub policy, NULL otherwise and rte_errno is set. |
| 5659 | */ |
| 5660 | static struct mlx5_flow_meter_sub_policy * |
| 5661 | get_meter_sub_policy(struct rte_eth_dev *dev, |
| 5662 | struct rte_flow *flow, |
| 5663 | struct mlx5_flow_workspace *wks, |
| 5664 | const struct rte_flow_attr *attr, |
| 5665 | const struct rte_flow_item items[], |
| 5666 | struct rte_flow_error *error) |
| 5667 | { |
| 5668 | struct mlx5_flow_meter_policy *policy; |
| 5669 | struct mlx5_flow_meter_policy *final_policy; |
| 5670 | struct mlx5_flow_meter_sub_policy *sub_policy = NULL; |
| 5671 | |
| 5672 | policy = wks->policy; |
| 5673 | final_policy = policy->is_hierarchy ? wks->final_policy : policy; |
| 5674 | if (final_policy->is_rss || final_policy->is_queue) { |
| 5675 | struct mlx5_flow_rss_desc rss_desc_v[MLX5_MTR_RTE_COLORS]; |
| 5676 | struct mlx5_flow_rss_desc *rss_desc[MLX5_MTR_RTE_COLORS] = {0}; |
| 5677 | uint32_t i; |
| 5678 | |
| 5679 | /* |
| 5680 | * This is a tmp dev_flow, |
| 5681 | * no need to register any matcher for it in translate. |
| 5682 | */ |
| 5683 | wks->skip_matcher_reg = 1; |
| 5684 | for (i = 0; i < MLX5_MTR_RTE_COLORS; i++) { |
| 5685 | struct mlx5_flow dev_flow = {0}; |
| 5686 | struct mlx5_flow_handle dev_handle = { {0} }; |
| 5687 | uint8_t fate = final_policy->act_cnt[i].fate_action; |
| 5688 | |
| 5689 | if (fate == MLX5_FLOW_FATE_SHARED_RSS) { |
| 5690 | const struct rte_flow_action_rss *rss_act = |
| 5691 | final_policy->act_cnt[i].rss->conf; |
| 5692 | struct rte_flow_action rss_actions[2] = { |
| 5693 | [0] = { |
| 5694 | .type = RTE_FLOW_ACTION_TYPE_RSS, |
| 5695 | .conf = rss_act, |
| 5696 | }, |
| 5697 | [1] = { |
| 5698 | .type = RTE_FLOW_ACTION_TYPE_END, |
| 5699 | .conf = NULL, |
| 5700 | } |
| 5701 | }; |
| 5702 | |
| 5703 | dev_flow.handle = &dev_handle; |
| 5704 | dev_flow.ingress = attr->ingress; |
| 5705 | dev_flow.flow = flow; |
| 5706 | dev_flow.external = 0; |
| 5707 | #ifdef HAVE_IBV_FLOW_DV_SUPPORT |
| 5708 | dev_flow.dv.transfer = attr->transfer; |
| 5709 | #endif |
| 5710 | /** |
| 5711 | * Translate RSS action to get rss hash fields. |
| 5712 | */ |
| 5713 | if (flow_drv_translate(dev, &dev_flow, attr, |
| 5714 | items, rss_actions, error)) |
| 5715 | goto exit; |
| 5716 | rss_desc_v[i] = wks->rss_desc; |
| 5717 | rss_desc_v[i].symmetric_hash_function = |
no test coverage detected