Home
last modified time | relevance | path

Searched refs:offmap (Results 1 – 7 of 7) sorted by relevance

/linux/kernel/bpf/
H A Doffload.c120 static int bpf_map_offload_ndo(struct bpf_offloaded_map *offmap, in bpf_map_offload_ndo() argument
129 data.offmap = offmap; in bpf_map_offload_ndo()
131 netdev = offmap->netdev; in bpf_map_offload_ndo()
136 static void __bpf_map_offload_destroy(struct bpf_offloaded_map *offmap) in __bpf_map_offload_destroy() argument
138 WARN_ON(bpf_map_offload_ndo(offmap, BPF_OFFLOAD_MAP_FREE)); in __bpf_map_offload_destroy()
140 bpf_map_free_id(&offmap->map); in __bpf_map_offload_destroy()
141 list_del_init(&offmap->offloads); in __bpf_map_offload_destroy()
142 offmap->netdev = NULL; in __bpf_map_offload_destroy()
149 struct bpf_offloaded_map *offmap, *mtmp; in __bpf_offload_dev_netdev_unregister() local
173 list_for_each_entry(offmap, &ondev->maps, offloads) in __bpf_offload_dev_netdev_unregister()
[all …]
/linux/drivers/net/ethernet/netronome/nfp/bpf/
H A Doffload.c264 for (i = 0; i < DIV_ROUND_UP(nfp_map->offmap->map.value_size, 4); i++) in nfp_map_bpf_byte_swap()
278 for (i = 0; i < DIV_ROUND_UP(nfp_map->offmap->map.value_size, 4); i++) in nfp_map_bpf_byte_swap_record()
285 nfp_bpf_map_lookup_entry(struct bpf_offloaded_map *offmap, in nfp_bpf_map_lookup_entry() argument
290 err = nfp_bpf_ctrl_lookup_entry(offmap, key, value); in nfp_bpf_map_lookup_entry()
294 nfp_map_bpf_byte_swap(offmap->dev_priv, value); in nfp_bpf_map_lookup_entry()
299 nfp_bpf_map_update_entry(struct bpf_offloaded_map *offmap, in nfp_bpf_map_update_entry() argument
302 nfp_map_bpf_byte_swap(offmap->dev_priv, value); in nfp_bpf_map_update_entry()
303 nfp_map_bpf_byte_swap_record(offmap->dev_priv, value); in nfp_bpf_map_update_entry()
304 return nfp_bpf_ctrl_update_entry(offmap, key, value, flags); in nfp_bpf_map_update_entry()
308 nfp_bpf_map_get_next_key(struct bpf_offloaded_map *offmap, in nfp_bpf_map_get_next_key() argument
[all …]
H A Dcmsg.c202 struct bpf_map *map = &nfp_map->offmap->map; in nfp_bpf_ctrl_op_cache_get()
292 nfp_bpf_ctrl_entry_op(struct bpf_offloaded_map *offmap, enum nfp_ccm_type op, in nfp_bpf_ctrl_entry_op() argument
295 struct nfp_bpf_map *nfp_map = offmap->dev_priv; in nfp_bpf_ctrl_entry_op()
298 struct bpf_map *map = &offmap->map; in nfp_bpf_ctrl_entry_op()
383 int nfp_bpf_ctrl_update_entry(struct bpf_offloaded_map *offmap, in nfp_bpf_ctrl_update_entry() argument
386 return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_UPDATE, in nfp_bpf_ctrl_update_entry()
390 int nfp_bpf_ctrl_del_entry(struct bpf_offloaded_map *offmap, void *key) in nfp_bpf_ctrl_del_entry() argument
392 return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_DELETE, in nfp_bpf_ctrl_del_entry()
396 int nfp_bpf_ctrl_lookup_entry(struct bpf_offloaded_map *offmap, in nfp_bpf_ctrl_lookup_entry() argument
399 return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_LOOKUP, in nfp_bpf_ctrl_lookup_entry()
[all …]
H A Dmain.h210 struct bpf_offloaded_map *offmap; member
598 int nfp_bpf_ctrl_getfirst_entry(struct bpf_offloaded_map *offmap,
600 int nfp_bpf_ctrl_update_entry(struct bpf_offloaded_map *offmap,
602 int nfp_bpf_ctrl_del_entry(struct bpf_offloaded_map *offmap, void *key);
603 int nfp_bpf_ctrl_lookup_entry(struct bpf_offloaded_map *offmap,
605 int nfp_bpf_ctrl_getnext_entry(struct bpf_offloaded_map *offmap,
H A Dverifier.c87 struct bpf_offloaded_map *offmap; in nfp_bpf_map_update_value_ok() local
99 offmap = map_to_offmap(reg1->map_ptr); in nfp_bpf_map_update_value_ok()
100 nfp_map = offmap->dev_priv; in nfp_bpf_map_update_value_ok()
103 for (i = 0; i < offmap->map.value_size; i++) { in nfp_bpf_map_update_value_ok()
421 struct bpf_offloaded_map *offmap; in nfp_bpf_map_mark_used() local
433 offmap = map_to_offmap(reg->map_ptr); in nfp_bpf_map_mark_used()
434 nfp_map = offmap->dev_priv; in nfp_bpf_map_mark_used()
436 if (off + size > offmap->map.value_size) { in nfp_bpf_map_mark_used()
/linux/drivers/net/netdevsim/
H A Dbpf.c333 static int nsim_map_key_find(struct bpf_offloaded_map *offmap, void *key) in nsim_map_key_find() argument
335 struct nsim_bpf_bound_map *nmap = offmap->dev_priv; in nsim_map_key_find()
339 if (nsim_map_key_match(&offmap->map, &nmap->entry[i], key)) in nsim_map_key_find()
346 nsim_map_alloc_elem(struct bpf_offloaded_map *offmap, unsigned int idx) in nsim_map_alloc_elem() argument
348 struct nsim_bpf_bound_map *nmap = offmap->dev_priv; in nsim_map_alloc_elem()
350 nmap->entry[idx].key = kmalloc(offmap->map.key_size, in nsim_map_alloc_elem()
354 nmap->entry[idx].value = kmalloc(offmap->map.value_size, in nsim_map_alloc_elem()
366 nsim_map_get_next_key(struct bpf_offloaded_map *offmap, in nsim_map_get_next_key() argument
369 struct nsim_bpf_bound_map *nmap = offmap->dev_priv; in nsim_map_get_next_key()
375 idx = nsim_map_key_find(offmap, key); in nsim_map_get_next_key()
[all …]
/linux/include/linux/
H A Dnetdevice.h982 struct bpf_offloaded_map *offmap; member