| 11599 | } |
| 11600 | |
| 11601 | static bool |
| 11602 | mlx5_access_tunnel_offload_db |
| 11603 | (struct rte_eth_dev *dev, |
| 11604 | bool (*match)(struct rte_eth_dev *, |
| 11605 | struct mlx5_flow_tunnel *, const void *), |
| 11606 | void (*hit)(struct rte_eth_dev *, struct mlx5_flow_tunnel *, void *), |
| 11607 | void (*miss)(struct rte_eth_dev *, void *), |
| 11608 | void *ctx, bool lock_op) |
| 11609 | { |
| 11610 | bool verdict = false; |
| 11611 | struct mlx5_flow_tunnel_hub *thub = mlx5_tunnel_hub(dev); |
| 11612 | struct mlx5_flow_tunnel *tunnel; |
| 11613 | |
| 11614 | rte_spinlock_lock(&thub->sl); |
| 11615 | LIST_FOREACH(tunnel, &thub->tunnels, chain) { |
| 11616 | verdict = match(dev, tunnel, (const void *)ctx); |
| 11617 | if (verdict) |
| 11618 | break; |
| 11619 | } |
| 11620 | if (!lock_op) |
| 11621 | rte_spinlock_unlock(&thub->sl); |
| 11622 | if (verdict && hit) |
| 11623 | hit(dev, tunnel, ctx); |
| 11624 | if (!verdict && miss) |
| 11625 | miss(dev, ctx); |
| 11626 | if (lock_op) |
| 11627 | rte_spinlock_unlock(&thub->sl); |
| 11628 | |
| 11629 | return verdict; |
| 11630 | } |
| 11631 | |
| 11632 | struct tunnel_db_find_tunnel_id_ctx { |
| 11633 | uint32_t tunnel_id; |
no test coverage detected