offmap 202 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c struct bpf_map *map = &nfp_map->offmap->map; offmap 292 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c nfp_bpf_ctrl_entry_op(struct bpf_offloaded_map *offmap, enum nfp_ccm_type op, offmap 295 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c struct nfp_bpf_map *nfp_map = offmap->dev_priv; offmap 298 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c struct bpf_map *map = &offmap->map; offmap 383 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c int nfp_bpf_ctrl_update_entry(struct bpf_offloaded_map *offmap, offmap 386 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_UPDATE, offmap 390 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c int nfp_bpf_ctrl_del_entry(struct bpf_offloaded_map *offmap, void *key) offmap 392 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_DELETE, offmap 396 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c int nfp_bpf_ctrl_lookup_entry(struct bpf_offloaded_map *offmap, offmap 399 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_LOOKUP, offmap 403 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c int nfp_bpf_ctrl_getfirst_entry(struct bpf_offloaded_map *offmap, offmap 406 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_GETFIRST, offmap 410 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c int nfp_bpf_ctrl_getnext_entry(struct bpf_offloaded_map *offmap, offmap 413 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c return nfp_bpf_ctrl_entry_op(offmap, NFP_CCM_TYPE_BPF_MAP_GETNEXT, offmap 210 drivers/net/ethernet/netronome/nfp/bpf/main.h struct bpf_offloaded_map *offmap; offmap 596 drivers/net/ethernet/netronome/nfp/bpf/main.h int nfp_bpf_ctrl_getfirst_entry(struct bpf_offloaded_map *offmap, offmap 598 drivers/net/ethernet/netronome/nfp/bpf/main.h int nfp_bpf_ctrl_update_entry(struct bpf_offloaded_map *offmap, offmap 600 drivers/net/ethernet/netronome/nfp/bpf/main.h int nfp_bpf_ctrl_del_entry(struct bpf_offloaded_map *offmap, void *key); offmap 601 drivers/net/ethernet/netronome/nfp/bpf/main.h int nfp_bpf_ctrl_lookup_entry(struct bpf_offloaded_map *offmap, offmap 603 drivers/net/ethernet/netronome/nfp/bpf/main.h int nfp_bpf_ctrl_getnext_entry(struct bpf_offloaded_map *offmap, offmap 260 drivers/net/ethernet/netronome/nfp/bpf/offload.c for (i = 0; i < DIV_ROUND_UP(nfp_map->offmap->map.value_size, 4); i++) offmap 274 drivers/net/ethernet/netronome/nfp/bpf/offload.c for (i = 0; i < DIV_ROUND_UP(nfp_map->offmap->map.value_size, 4); i++) offmap 281 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_bpf_map_lookup_entry(struct bpf_offloaded_map *offmap, offmap 286 drivers/net/ethernet/netronome/nfp/bpf/offload.c err = nfp_bpf_ctrl_lookup_entry(offmap, key, value); offmap 290 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_map_bpf_byte_swap(offmap->dev_priv, value); offmap 295 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_bpf_map_update_entry(struct bpf_offloaded_map *offmap, offmap 298 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_map_bpf_byte_swap(offmap->dev_priv, value); offmap 299 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_map_bpf_byte_swap_record(offmap->dev_priv, value); offmap 300 drivers/net/ethernet/netronome/nfp/bpf/offload.c return nfp_bpf_ctrl_update_entry(offmap, key, value, flags); offmap 304 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_bpf_map_get_next_key(struct bpf_offloaded_map *offmap, offmap 308 drivers/net/ethernet/netronome/nfp/bpf/offload.c return nfp_bpf_ctrl_getfirst_entry(offmap, next_key); offmap 309 drivers/net/ethernet/netronome/nfp/bpf/offload.c return nfp_bpf_ctrl_getnext_entry(offmap, key, next_key); offmap 313 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_bpf_map_delete_elem(struct bpf_offloaded_map *offmap, void *key) offmap 315 drivers/net/ethernet/netronome/nfp/bpf/offload.c if (offmap->map.map_type == BPF_MAP_TYPE_ARRAY) offmap 317 drivers/net/ethernet/netronome/nfp/bpf/offload.c return nfp_bpf_ctrl_del_entry(offmap, key); offmap 328 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_bpf_map_alloc(struct nfp_app_bpf *bpf, struct bpf_offloaded_map *offmap) offmap 337 drivers/net/ethernet/netronome/nfp/bpf/offload.c if (offmap->map.map_flags || offmap 338 drivers/net/ethernet/netronome/nfp/bpf/offload.c offmap->map.numa_node != NUMA_NO_NODE) { offmap 343 drivers/net/ethernet/netronome/nfp/bpf/offload.c if (!(bpf->maps.types & 1 << offmap->map.map_type)) { offmap 352 drivers/net/ethernet/netronome/nfp/bpf/offload.c offmap->map.max_entries) { offmap 354 drivers/net/ethernet/netronome/nfp/bpf/offload.c offmap->map.max_entries, offmap 359 drivers/net/ethernet/netronome/nfp/bpf/offload.c if (round_up(offmap->map.key_size, 8) + offmap 360 drivers/net/ethernet/netronome/nfp/bpf/offload.c round_up(offmap->map.value_size, 8) > bpf->maps.max_elem_sz) { offmap 362 drivers/net/ethernet/netronome/nfp/bpf/offload.c round_up(offmap->map.key_size, 8) + offmap 363 drivers/net/ethernet/netronome/nfp/bpf/offload.c round_up(offmap->map.value_size, 8), offmap 367 drivers/net/ethernet/netronome/nfp/bpf/offload.c if (offmap->map.key_size > bpf->maps.max_key_sz) { offmap 369 drivers/net/ethernet/netronome/nfp/bpf/offload.c offmap->map.key_size, bpf->maps.max_key_sz); offmap 372 drivers/net/ethernet/netronome/nfp/bpf/offload.c if (offmap->map.value_size > bpf->maps.max_val_sz) { offmap 374 drivers/net/ethernet/netronome/nfp/bpf/offload.c offmap->map.value_size, bpf->maps.max_val_sz); offmap 378 drivers/net/ethernet/netronome/nfp/bpf/offload.c use_map_size = DIV_ROUND_UP(offmap->map.value_size, 4) * offmap 385 drivers/net/ethernet/netronome/nfp/bpf/offload.c offmap->dev_priv = nfp_map; offmap 386 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_map->offmap = offmap; offmap 390 drivers/net/ethernet/netronome/nfp/bpf/offload.c res = nfp_bpf_ctrl_alloc_map(bpf, &offmap->map); offmap 397 drivers/net/ethernet/netronome/nfp/bpf/offload.c offmap->dev_ops = &nfp_bpf_map_ops; offmap 399 drivers/net/ethernet/netronome/nfp/bpf/offload.c bpf->map_elems_in_use += offmap->map.max_entries; offmap 406 drivers/net/ethernet/netronome/nfp/bpf/offload.c nfp_bpf_map_free(struct nfp_app_bpf *bpf, struct bpf_offloaded_map *offmap) offmap 408 drivers/net/ethernet/netronome/nfp/bpf/offload.c struct nfp_bpf_map *nfp_map = offmap->dev_priv; offmap 414 drivers/net/ethernet/netronome/nfp/bpf/offload.c bpf->map_elems_in_use -= offmap->map.max_entries; offmap 425 drivers/net/ethernet/netronome/nfp/bpf/offload.c return nfp_bpf_map_alloc(app->priv, bpf->offmap); offmap 427 drivers/net/ethernet/netronome/nfp/bpf/offload.c return nfp_bpf_map_free(app->priv, bpf->offmap); offmap 87 drivers/net/ethernet/netronome/nfp/bpf/verifier.c struct bpf_offloaded_map *offmap; offmap 99 drivers/net/ethernet/netronome/nfp/bpf/verifier.c offmap = map_to_offmap(reg1->map_ptr); offmap 100 drivers/net/ethernet/netronome/nfp/bpf/verifier.c nfp_map = offmap->dev_priv; offmap 103 drivers/net/ethernet/netronome/nfp/bpf/verifier.c for (i = 0; i < offmap->map.value_size; i++) { offmap 421 drivers/net/ethernet/netronome/nfp/bpf/verifier.c struct bpf_offloaded_map *offmap; offmap 433 drivers/net/ethernet/netronome/nfp/bpf/verifier.c offmap = map_to_offmap(reg->map_ptr); offmap 434 drivers/net/ethernet/netronome/nfp/bpf/verifier.c nfp_map = offmap->dev_priv; offmap 436 drivers/net/ethernet/netronome/nfp/bpf/verifier.c if (off + size > offmap->map.value_size) { offmap 333 drivers/net/netdevsim/bpf.c static int nsim_map_key_find(struct bpf_offloaded_map *offmap, void *key) offmap 335 drivers/net/netdevsim/bpf.c struct nsim_bpf_bound_map *nmap = offmap->dev_priv; offmap 339 drivers/net/netdevsim/bpf.c if (nsim_map_key_match(&offmap->map, &nmap->entry[i], key)) offmap 346 drivers/net/netdevsim/bpf.c nsim_map_alloc_elem(struct bpf_offloaded_map *offmap, unsigned int idx) offmap 348 drivers/net/netdevsim/bpf.c struct nsim_bpf_bound_map *nmap = offmap->dev_priv; offmap 350 drivers/net/netdevsim/bpf.c nmap->entry[idx].key = kmalloc(offmap->map.key_size, GFP_USER); offmap 353 drivers/net/netdevsim/bpf.c nmap->entry[idx].value = kmalloc(offmap->map.value_size, GFP_USER); offmap 364 drivers/net/netdevsim/bpf.c nsim_map_get_next_key(struct bpf_offloaded_map *offmap, offmap 367 drivers/net/netdevsim/bpf.c struct nsim_bpf_bound_map *nmap = offmap->dev_priv; offmap 373 drivers/net/netdevsim/bpf.c idx = nsim_map_key_find(offmap, key); offmap 382 drivers/net/netdevsim/bpf.c offmap->map.key_size); offmap 395 drivers/net/netdevsim/bpf.c nsim_map_lookup_elem(struct bpf_offloaded_map *offmap, void *key, void *value) offmap 397 drivers/net/netdevsim/bpf.c struct nsim_bpf_bound_map *nmap = offmap->dev_priv; offmap 402 drivers/net/netdevsim/bpf.c idx = nsim_map_key_find(offmap, key); offmap 404 drivers/net/netdevsim/bpf.c memcpy(value, nmap->entry[idx].value, offmap->map.value_size); offmap 412 drivers/net/netdevsim/bpf.c nsim_map_update_elem(struct bpf_offloaded_map *offmap, offmap 415 drivers/net/netdevsim/bpf.c struct nsim_bpf_bound_map *nmap = offmap->dev_priv; offmap 420 drivers/net/netdevsim/bpf.c idx = nsim_map_key_find(offmap, key); offmap 439 drivers/net/netdevsim/bpf.c err = nsim_map_alloc_elem(offmap, idx); offmap 444 drivers/net/netdevsim/bpf.c memcpy(nmap->entry[idx].key, key, offmap->map.key_size); offmap 445 drivers/net/netdevsim/bpf.c memcpy(nmap->entry[idx].value, value, offmap->map.value_size); offmap 452 drivers/net/netdevsim/bpf.c static int nsim_map_delete_elem(struct bpf_offloaded_map *offmap, void *key) offmap 454 drivers/net/netdevsim/bpf.c struct nsim_bpf_bound_map *nmap = offmap->dev_priv; offmap 457 drivers/net/netdevsim/bpf.c if (offmap->map.map_type == BPF_MAP_TYPE_ARRAY) offmap 462 drivers/net/netdevsim/bpf.c idx = nsim_map_key_find(offmap, key); offmap 482 drivers/net/netdevsim/bpf.c nsim_bpf_map_alloc(struct netdevsim *ns, struct bpf_offloaded_map *offmap) offmap 487 drivers/net/netdevsim/bpf.c if (WARN_ON(offmap->map.map_type != BPF_MAP_TYPE_ARRAY && offmap 488 drivers/net/netdevsim/bpf.c offmap->map.map_type != BPF_MAP_TYPE_HASH)) offmap 490 drivers/net/netdevsim/bpf.c if (offmap->map.max_entries > NSIM_BPF_MAX_KEYS) offmap 492 drivers/net/netdevsim/bpf.c if (offmap->map.map_flags) offmap 499 drivers/net/netdevsim/bpf.c offmap->dev_priv = nmap; offmap 501 drivers/net/netdevsim/bpf.c nmap->map = offmap; offmap 504 drivers/net/netdevsim/bpf.c if (offmap->map.map_type == BPF_MAP_TYPE_ARRAY) { offmap 508 drivers/net/netdevsim/bpf.c err = nsim_map_alloc_elem(offmap, i); offmap 516 drivers/net/netdevsim/bpf.c offmap->dev_ops = &nsim_bpf_map_ops; offmap 530 drivers/net/netdevsim/bpf.c static void nsim_bpf_map_free(struct bpf_offloaded_map *offmap) offmap 532 drivers/net/netdevsim/bpf.c struct nsim_bpf_bound_map *nmap = offmap->dev_priv; offmap 572 drivers/net/netdevsim/bpf.c return nsim_bpf_map_alloc(ns, bpf->offmap); offmap 574 drivers/net/netdevsim/bpf.c nsim_bpf_map_free(bpf->offmap); offmap 897 include/linux/netdevice.h struct bpf_offloaded_map *offmap; offmap 346 kernel/bpf/offload.c static int bpf_map_offload_ndo(struct bpf_offloaded_map *offmap, offmap 355 kernel/bpf/offload.c data.offmap = offmap; offmap 357 kernel/bpf/offload.c netdev = offmap->netdev; offmap 366 kernel/bpf/offload.c struct bpf_offloaded_map *offmap; offmap 375 kernel/bpf/offload.c offmap = kzalloc(sizeof(*offmap), GFP_USER); offmap 376 kernel/bpf/offload.c if (!offmap) offmap 379 kernel/bpf/offload.c bpf_map_init_from_attr(&offmap->map, attr); offmap 383 kernel/bpf/offload.c offmap->netdev = __dev_get_by_index(net, attr->map_ifindex); offmap 384 kernel/bpf/offload.c err = bpf_dev_offload_check(offmap->netdev); offmap 388 kernel/bpf/offload.c ondev = bpf_offload_find_netdev(offmap->netdev); offmap 394 kernel/bpf/offload.c err = bpf_map_offload_ndo(offmap, BPF_OFFLOAD_MAP_ALLOC); offmap 398 kernel/bpf/offload.c list_add_tail(&offmap->offloads, &ondev->maps); offmap 402 kernel/bpf/offload.c return &offmap->map; offmap 407 kernel/bpf/offload.c kfree(offmap); offmap 411 kernel/bpf/offload.c static void __bpf_map_offload_destroy(struct bpf_offloaded_map *offmap) offmap 413 kernel/bpf/offload.c WARN_ON(bpf_map_offload_ndo(offmap, BPF_OFFLOAD_MAP_FREE)); offmap 415 kernel/bpf/offload.c bpf_map_free_id(&offmap->map, true); offmap 416 kernel/bpf/offload.c list_del_init(&offmap->offloads); offmap 417 kernel/bpf/offload.c offmap->netdev = NULL; offmap 422 kernel/bpf/offload.c struct bpf_offloaded_map *offmap = map_to_offmap(map); offmap 426 kernel/bpf/offload.c if (offmap->netdev) offmap 427 kernel/bpf/offload.c __bpf_map_offload_destroy(offmap); offmap 431 kernel/bpf/offload.c kfree(offmap); offmap 436 kernel/bpf/offload.c struct bpf_offloaded_map *offmap = map_to_offmap(map); offmap 440 kernel/bpf/offload.c if (offmap->netdev) offmap 441 kernel/bpf/offload.c ret = offmap->dev_ops->map_lookup_elem(offmap, key, value); offmap 450 kernel/bpf/offload.c struct bpf_offloaded_map *offmap = map_to_offmap(map); offmap 457 kernel/bpf/offload.c if (offmap->netdev) offmap 458 kernel/bpf/offload.c ret = offmap->dev_ops->map_update_elem(offmap, key, value, offmap 467 kernel/bpf/offload.c struct bpf_offloaded_map *offmap = map_to_offmap(map); offmap 471 kernel/bpf/offload.c if (offmap->netdev) offmap 472 kernel/bpf/offload.c ret = offmap->dev_ops->map_delete_elem(offmap, key); offmap 480 kernel/bpf/offload.c struct bpf_offloaded_map *offmap = map_to_offmap(map); offmap 484 kernel/bpf/offload.c if (offmap->netdev) offmap 485 kernel/bpf/offload.c ret = offmap->dev_ops->map_get_next_key(offmap, key, next_key); offmap 492 kernel/bpf/offload.c struct bpf_offloaded_map *offmap; offmap 505 kernel/bpf/offload.c if (args->offmap->netdev) { offmap 506 kernel/bpf/offload.c args->info->ifindex = args->offmap->netdev->ifindex; offmap 507 kernel/bpf/offload.c net = dev_net(args->offmap->netdev); offmap 524 kernel/bpf/offload.c .offmap = map_to_offmap(map), offmap 581 kernel/bpf/offload.c struct bpf_offloaded_map *offmap; offmap 586 kernel/bpf/offload.c offmap = map_to_offmap(map); offmap 589 kernel/bpf/offload.c ret = __bpf_offload_dev_match(prog, offmap->netdev); offmap 632 kernel/bpf/offload.c struct bpf_offloaded_map *offmap, *mtmp; offmap 654 kernel/bpf/offload.c list_for_each_entry(offmap, &ondev->maps, offloads) offmap 655 kernel/bpf/offload.c offmap->netdev = altdev->netdev; offmap 660 kernel/bpf/offload.c list_for_each_entry_safe(offmap, mtmp, &ondev->maps, offloads) offmap 661 kernel/bpf/offload.c __bpf_map_offload_destroy(offmap);