Function report |
Source Code:kernel\bpf\lpm_trie.c |
Create Date:2022-07-28 13:13:19 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Called from syscall or from eBPF program
Proto:static int trie_update_elem(struct bpf_map *map, void *_key, void *value, u64 flags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_map * | map | |
void * | _key | |
void * | value | |
u64 | flags |
304 | struct lpm_trie_node * node, * im_node = NULL, * new_node = NULL |
309 | matchlen = 0 |
310 | ret = 0 |
312 | If Value for the false possibility is greater at compile time(flags > update existing element ) Then Return -EINVAL |
315 | If up to 32 for AF_INET, 128 for AF_INET6 > max_prefixlen Then Return -EINVAL |
318 | raw_spin_lock_irqsave( & lock, irq_flags) |
322 | If n_entries == max_entries Then |
327 | new_node = lpm_trie_node_alloc(trie, value) |
328 | If Not new_node Then |
333 | n_entries++ |
338 | No 3D Now!(data, Arbitrary size , data_size) |
351 | If prefixlen != matchlen || prefixlen == up to 32 for AF_INET, 128 for AF_INET6 || prefixlen == max_prefixlen Then Break |
363 | If Not node Then |
365 | Go to out |
375 | If Not (flags & Intermediate node ) Then n_entries-- |
381 | Go to out |
387 | If matchlen == up to 32 for AF_INET, 128 for AF_INET6 Then |
391 | Go to out |
394 | im_node = lpm_trie_node_alloc(trie, NULL) |
395 | If Not im_node Then |
401 | flags |= Intermediate node |
402 | No 3D Now!(data, data, data_size) |
408 | Else |
416 | out : |
417 | If ret Then |
425 | raw_spin_unlock_irqrestore( & lock, irq_flags) |
427 | Return ret |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |