/kernel/linux/linux-5.10/kernel/bpf/ |
D | offload.c | 346 static int bpf_map_offload_ndo(struct bpf_offloaded_map *offmap, in bpf_map_offload_ndo() argument 355 data.offmap = offmap; in bpf_map_offload_ndo() 357 netdev = offmap->netdev; in bpf_map_offload_ndo() 366 struct bpf_offloaded_map *offmap; in bpf_map_offload_map_alloc() local 375 offmap = kzalloc(sizeof(*offmap), GFP_USER); in bpf_map_offload_map_alloc() 376 if (!offmap) in bpf_map_offload_map_alloc() 379 bpf_map_init_from_attr(&offmap->map, attr); in bpf_map_offload_map_alloc() 383 offmap->netdev = __dev_get_by_index(net, attr->map_ifindex); in bpf_map_offload_map_alloc() 384 err = bpf_dev_offload_check(offmap->netdev); in bpf_map_offload_map_alloc() 388 ondev = bpf_offload_find_netdev(offmap->netdev); in bpf_map_offload_map_alloc() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/netronome/nfp/bpf/ |
D | offload.c | 264 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 …]
|
D | cmsg.c | 202 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 …]
|
D | main.h | 210 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,
|
D | verifier.c | 87 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()
|
/kernel/linux/linux-5.10/drivers/net/netdevsim/ |
D | bpf.c | 337 static int nsim_map_key_find(struct bpf_offloaded_map *offmap, void *key) in nsim_map_key_find() argument 339 struct nsim_bpf_bound_map *nmap = offmap->dev_priv; in nsim_map_key_find() 343 if (nsim_map_key_match(&offmap->map, &nmap->entry[i], key)) in nsim_map_key_find() 350 nsim_map_alloc_elem(struct bpf_offloaded_map *offmap, unsigned int idx) in nsim_map_alloc_elem() argument 352 struct nsim_bpf_bound_map *nmap = offmap->dev_priv; in nsim_map_alloc_elem() 354 nmap->entry[idx].key = kmalloc(offmap->map.key_size, in nsim_map_alloc_elem() 358 nmap->entry[idx].value = kmalloc(offmap->map.value_size, in nsim_map_alloc_elem() 370 nsim_map_get_next_key(struct bpf_offloaded_map *offmap, in nsim_map_get_next_key() argument 373 struct nsim_bpf_bound_map *nmap = offmap->dev_priv; in nsim_map_get_next_key() 379 idx = nsim_map_key_find(offmap, key); in nsim_map_get_next_key() [all …]
|
/kernel/linux/linux-5.10/include/linux/ |
D | netdevice.h | 926 struct bpf_offloaded_map *offmap; member
|