MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_access_tunnel_offload_db

Function mlx5_access_tunnel_offload_db

dpdk/drivers/net/mlx5/mlx5_flow.c:11601–11630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11599}
11600
11601static bool
11602mlx5_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
11632struct tunnel_db_find_tunnel_id_ctx {
11633 uint32_t tunnel_id;

Callers 4

mlx5_find_tunnel_idFunction · 0.85
mlx5_get_flow_tunnelFunction · 0.85

Calls 4

mlx5_tunnel_hubFunction · 0.85
rte_spinlock_lockFunction · 0.50
matchFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected