Lines Matching defs:map
15 static struct xsk_map_node *xsk_map_node_alloc(struct xsk_map *map,
20 node = bpf_map_kzalloc(&map->map, sizeof(*node),
25 bpf_map_inc(&map->map);
26 atomic_inc(&map->count);
28 node->map = map;
35 struct xsk_map *map = node->map;
37 bpf_map_put(&node->map->map);
39 atomic_dec(&map->count);
82 bpf_map_init_from_attr(&m->map, attr);
85 return &m->map;
88 static u64 xsk_map_mem_usage(const struct bpf_map *map)
90 struct xsk_map *m = container_of(map, struct xsk_map, map);
92 return struct_size(m, xsk_map, map->max_entries) +
96 static void xsk_map_free(struct bpf_map *map)
98 struct xsk_map *m = container_of(map, struct xsk_map, map);
104 static int xsk_map_get_next_key(struct bpf_map *map, void *key, void *next_key)
106 struct xsk_map *m = container_of(map, struct xsk_map, map);
110 if (index >= m->map.max_entries) {
115 if (index == m->map.max_entries - 1)
121 static int xsk_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf)
127 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 5);
141 static void *__xsk_map_lookup_elem(struct bpf_map *map, u32 key)
143 struct xsk_map *m = container_of(map, struct xsk_map, map);
145 if (key >= map->max_entries)
151 static void *xsk_map_lookup_elem(struct bpf_map *map, void *key)
153 return __xsk_map_lookup_elem(map, *(u32 *)key);
156 static void *xsk_map_lookup_elem_sys_only(struct bpf_map *map, void *key)
161 static long xsk_map_update_elem(struct bpf_map *map, void *key, void *value,
164 struct xsk_map *m = container_of(map, struct xsk_map, map);
174 if (unlikely(i >= m->map.max_entries))
222 static long xsk_map_delete_elem(struct bpf_map *map, void *key)
224 struct xsk_map *m = container_of(map, struct xsk_map, map);
229 if (k >= map->max_entries)
242 static long xsk_map_redirect(struct bpf_map *map, u64 index, u64 flags)
244 return __bpf_xdp_redirect_map(map, index, flags, 0,
248 void xsk_map_try_sock_delete(struct xsk_map *map, struct xdp_sock *xs,
251 spin_lock_bh(&map->lock);
256 spin_unlock_bh(&map->lock);