* Translate the rte_flow group index to HW table value. * * If tunnel offload is disabled, all group ids converted to flow table * id using the standard method. * If tunnel offload is enabled, group id can be converted using the * standard or tunnel conversion method. Group conversion method * selection depends on flags in `grp_info` parameter: * - Internal (grp_info.external == 0) groups c
| 10212 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 10213 | */ |
| 10214 | int |
| 10215 | mlx5_flow_group_to_table(struct rte_eth_dev *dev, |
| 10216 | const struct mlx5_flow_tunnel *tunnel, |
| 10217 | uint32_t group, uint32_t *table, |
| 10218 | const struct flow_grp_info *grp_info, |
| 10219 | struct rte_flow_error *error) |
| 10220 | { |
| 10221 | int ret; |
| 10222 | bool standard_translation; |
| 10223 | |
| 10224 | if (!grp_info->skip_scale && grp_info->external && |
| 10225 | group < MLX5_MAX_TABLES_EXTERNAL) |
| 10226 | group *= MLX5_FLOW_TABLE_FACTOR; |
| 10227 | if (is_tunnel_offload_active(dev)) { |
| 10228 | standard_translation = !grp_info->external || |
| 10229 | grp_info->std_tbl_fix; |
| 10230 | } else { |
| 10231 | standard_translation = true; |
| 10232 | } |
| 10233 | DRV_LOG(DEBUG, |
| 10234 | "port %u group=%u transfer=%d external=%d fdb_def_rule=%d translate=%s", |
| 10235 | dev->data->port_id, group, grp_info->transfer, |
| 10236 | grp_info->external, grp_info->fdb_def_rule, |
| 10237 | standard_translation ? "STANDARD" : "TUNNEL"); |
| 10238 | if (standard_translation) |
| 10239 | ret = flow_group_to_table(dev->data->port_id, group, table, |
| 10240 | grp_info, error); |
| 10241 | else |
| 10242 | ret = tunnel_flow_group_to_flow_table(dev, tunnel, group, |
| 10243 | table, error); |
| 10244 | |
| 10245 | return ret; |
| 10246 | } |
| 10247 | |
| 10248 | /** |
| 10249 | * Discover availability of metadata reg_c's. |
no test coverage detected