Function report |
Source Code:kernel\bpf\xskmap.c |
Create Date:2022-07-28 13:24:51 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:xsk_map_update_elem
Proto:static int xsk_map_update_elem(struct bpf_map *map, void *key, void *value, u64 map_flags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_map * | map | |
void * | key | |
void * | value | |
u64 | map_flags |
182 | If Value for the false possibility is greater at compile time(map_flags > update existing element ) Then Return -EINVAL |
184 | If Value for the false possibility is greater at compile time(i >= max_entries) Then Return -E2BIG |
187 | sock = sockfd_lookup(fd, & err) |
192 | sockfd_put(sock) |
193 | Return -EOPNOTSUPP |
198 | If Not xsk_is_setup_for_bpf_map(xs) Then |
199 | sockfd_put(sock) |
200 | Return -EOPNOTSUPP |
204 | node = xsk_map_node_alloc(m, map_entry) |
206 | sockfd_put(sock) |
210 | spin_lock_bh( & Synchronize map updates ) |
215 | Else if old_xs && map_flags == create new element if it didn't exist Then |
218 | Else if Not old_xs && map_flags == update existing element Then |
222 | xsk_map_sock_add(xs, node) |
223 | WRITE_ONCE( * map_entry, xs) |
224 | If old_xs Then xsk_map_sock_delete(old_xs, map_entry) |
226 | spin_unlock_bh( & Synchronize map updates ) |
227 | sockfd_put(sock) |
228 | Return 0 |
230 | out : |
231 | spin_unlock_bh( & Synchronize map updates ) |
232 | sockfd_put(sock) |
233 | xsk_map_node_free(node) |
234 | Return err |
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 |