Lines Matching defs:bloom
23 static u32 hash(struct bpf_bloom_filter *bloom, void *value,
29 h = jhash2(value, value_size / 4, bloom->hash_seed + index);
31 h = jhash(value, value_size, bloom->hash_seed + index);
33 return h & bloom->bitset_mask;
38 struct bpf_bloom_filter *bloom =
42 for (i = 0; i < bloom->nr_hash_funcs; i++) {
43 h = hash(bloom, value, map->value_size, i);
44 if (!test_bit(h, bloom->bitset))
53 struct bpf_bloom_filter *bloom =
60 for (i = 0; i < bloom->nr_hash_funcs; i++) {
61 h = hash(bloom, value, map->value_size, i);
62 set_bit(h, bloom->bitset);
99 struct bpf_bloom_filter *bloom;
116 /* For the bloom filter, the optimal bit array size that minimizes the
118 * expected entries in the bloom filter and k is the number of hash
146 bloom = bpf_map_area_alloc(sizeof(*bloom) + bitset_bytes, numa_node);
148 if (!bloom)
151 bpf_map_init_from_attr(&bloom->map, attr);
153 bloom->nr_hash_funcs = nr_hash_funcs;
154 bloom->bitset_mask = bitset_mask;
157 bloom->hash_seed = get_random_u32();
159 return &bloom->map;
164 struct bpf_bloom_filter *bloom =
167 bpf_map_area_free(bloom);
194 struct bpf_bloom_filter *bloom;
197 bloom = container_of(map, struct bpf_bloom_filter, map);
198 bitset_bytes = BITS_TO_BYTES((u64)bloom->bitset_mask + 1);
200 return sizeof(*bloom) + bitset_bytes;