* Check meter action from the action list. * * @param dev * Pointer to Ethernet device. * @param[in] actions * Pointer to the list of actions. * @param[out] has_mtr * Pointer to the meter exist flag. * @param[out] has_modify * Pointer to the flag showing there's packet change action. * @param[out] meter_id * Pointer to the meter id. * * @return * Total number of actions.
| 4910 | * Total number of actions. |
| 4911 | */ |
| 4912 | static int |
| 4913 | flow_check_meter_action(struct rte_eth_dev *dev, |
| 4914 | const struct rte_flow_action actions[], |
| 4915 | bool *has_mtr, bool *has_modify, uint32_t *meter_id) |
| 4916 | { |
| 4917 | const struct rte_flow_action_meter *mtr = NULL; |
| 4918 | int actions_n = 0; |
| 4919 | |
| 4920 | MLX5_ASSERT(has_mtr); |
| 4921 | *has_mtr = false; |
| 4922 | for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { |
| 4923 | switch (actions->type) { |
| 4924 | case RTE_FLOW_ACTION_TYPE_METER: |
| 4925 | mtr = actions->conf; |
| 4926 | *meter_id = mtr->mtr_id; |
| 4927 | *has_mtr = true; |
| 4928 | break; |
| 4929 | default: |
| 4930 | break; |
| 4931 | } |
| 4932 | if (!*has_mtr) |
| 4933 | *has_modify |= flow_check_modify_action_type(dev, |
| 4934 | actions->type); |
| 4935 | actions_n++; |
| 4936 | } |
| 4937 | /* Count RTE_FLOW_ACTION_TYPE_END. */ |
| 4938 | return actions_n + 1; |
| 4939 | } |
| 4940 | |
| 4941 | /** |
| 4942 | * Check if the flow should be split due to hairpin. |
no test coverage detected