• Home
  • Raw
  • Download

Lines Matching refs:attr

408 static int htab_map_alloc_check(union bpf_attr *attr)  in htab_map_alloc_check()  argument
410 bool percpu = (attr->map_type == BPF_MAP_TYPE_PERCPU_HASH || in htab_map_alloc_check()
411 attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); in htab_map_alloc_check()
412 bool lru = (attr->map_type == BPF_MAP_TYPE_LRU_HASH || in htab_map_alloc_check()
413 attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); in htab_map_alloc_check()
419 bool percpu_lru = (attr->map_flags & BPF_F_NO_COMMON_LRU); in htab_map_alloc_check()
420 bool prealloc = !(attr->map_flags & BPF_F_NO_PREALLOC); in htab_map_alloc_check()
421 bool zero_seed = (attr->map_flags & BPF_F_ZERO_SEED); in htab_map_alloc_check()
422 int numa_node = bpf_map_attr_numa_node(attr); in htab_map_alloc_check()
439 if (attr->map_flags & ~HTAB_CREATE_FLAG_MASK || in htab_map_alloc_check()
440 !bpf_map_flags_access_ok(attr->map_flags)) in htab_map_alloc_check()
455 if (attr->max_entries == 0 || attr->key_size == 0 || in htab_map_alloc_check()
456 attr->value_size == 0) in htab_map_alloc_check()
459 if ((u64)attr->key_size + attr->value_size >= KMALLOC_MAX_SIZE - in htab_map_alloc_check()
471 static struct bpf_map *htab_map_alloc(union bpf_attr *attr) in htab_map_alloc() argument
473 bool percpu = (attr->map_type == BPF_MAP_TYPE_PERCPU_HASH || in htab_map_alloc()
474 attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); in htab_map_alloc()
475 bool lru = (attr->map_type == BPF_MAP_TYPE_LRU_HASH || in htab_map_alloc()
476 attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); in htab_map_alloc()
482 bool percpu_lru = (attr->map_flags & BPF_F_NO_COMMON_LRU); in htab_map_alloc()
483 bool prealloc = !(attr->map_flags & BPF_F_NO_PREALLOC); in htab_map_alloc()
493 bpf_map_init_from_attr(&htab->map, attr); in htab_map_alloc()
500 htab->map.max_entries = roundup(attr->max_entries, in htab_map_alloc()
502 if (htab->map.max_entries < attr->max_entries) in htab_map_alloc()
503 htab->map.max_entries = rounddown(attr->max_entries, in htab_map_alloc()
1597 const union bpf_attr *attr, in __htab_map_lookup_and_delete_batch() argument
1605 void __user *uvalues = u64_to_user_ptr(attr->batch.values); in __htab_map_lookup_and_delete_batch()
1606 void __user *ukeys = u64_to_user_ptr(attr->batch.keys); in __htab_map_lookup_and_delete_batch()
1607 void __user *ubatch = u64_to_user_ptr(attr->batch.in_batch); in __htab_map_lookup_and_delete_batch()
1619 elem_map_flags = attr->batch.elem_flags; in __htab_map_lookup_and_delete_batch()
1624 map_flags = attr->batch.flags; in __htab_map_lookup_and_delete_batch()
1628 max_count = attr->batch.count; in __htab_map_lookup_and_delete_batch()
1803 ubatch = u64_to_user_ptr(attr->batch.out_batch); in __htab_map_lookup_and_delete_batch()
1815 htab_percpu_map_lookup_batch(struct bpf_map *map, const union bpf_attr *attr, in htab_percpu_map_lookup_batch() argument
1818 return __htab_map_lookup_and_delete_batch(map, attr, uattr, false, in htab_percpu_map_lookup_batch()
1824 const union bpf_attr *attr, in htab_percpu_map_lookup_and_delete_batch() argument
1827 return __htab_map_lookup_and_delete_batch(map, attr, uattr, true, in htab_percpu_map_lookup_and_delete_batch()
1832 htab_map_lookup_batch(struct bpf_map *map, const union bpf_attr *attr, in htab_map_lookup_batch() argument
1835 return __htab_map_lookup_and_delete_batch(map, attr, uattr, false, in htab_map_lookup_batch()
1841 const union bpf_attr *attr, in htab_map_lookup_and_delete_batch() argument
1844 return __htab_map_lookup_and_delete_batch(map, attr, uattr, true, in htab_map_lookup_and_delete_batch()
1850 const union bpf_attr *attr, in htab_lru_percpu_map_lookup_batch() argument
1853 return __htab_map_lookup_and_delete_batch(map, attr, uattr, false, in htab_lru_percpu_map_lookup_batch()
1859 const union bpf_attr *attr, in htab_lru_percpu_map_lookup_and_delete_batch() argument
1862 return __htab_map_lookup_and_delete_batch(map, attr, uattr, true, in htab_lru_percpu_map_lookup_and_delete_batch()
1867 htab_lru_map_lookup_batch(struct bpf_map *map, const union bpf_attr *attr, in htab_lru_map_lookup_batch() argument
1870 return __htab_map_lookup_and_delete_batch(map, attr, uattr, false, in htab_lru_map_lookup_batch()
1876 const union bpf_attr *attr, in htab_lru_map_lookup_and_delete_batch() argument
1879 return __htab_map_lookup_and_delete_batch(map, attr, uattr, true, in htab_lru_map_lookup_and_delete_batch()
2312 static int fd_htab_map_alloc_check(union bpf_attr *attr) in fd_htab_map_alloc_check() argument
2314 if (attr->value_size != sizeof(u32)) in fd_htab_map_alloc_check()
2316 return htab_map_alloc_check(attr); in fd_htab_map_alloc_check()
2379 static struct bpf_map *htab_of_map_alloc(union bpf_attr *attr) in htab_of_map_alloc() argument
2383 inner_map_meta = bpf_map_meta_alloc(attr->inner_map_fd); in htab_of_map_alloc()
2387 map = htab_map_alloc(attr); in htab_of_map_alloc()