The cpumap flush list is used to track entries that need to flushed from via the xdp_do_flush_map() function. This list used to be per-map, but there is really no reason for that. Instead make the flush list global for all devmaps, which simplifies __cpu_map_flush() and cpu_map_alloc().
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -966,7 +966,7 @@ int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, · 965 unmodified lines | |||
| 966 | struct bpf_prog *xdp_prog); | 966 | struct bpf_prog *xdp_prog); |
| 967 | 967 | ||
| 968 | struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key); | 968 | struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key); |
| 969 | void __cpu_map_flush(struct bpf_map *map); | 969 | void __cpu_map_flush(void); |
| 970 | int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp, | 970 | int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp, |
| 971 | struct net_device *dev_rx); | 971 | struct net_device *dev_rx); |
| 972 | 972 | ||
| @@ -1097,7 +1097,7 @@ struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) · 124 unmodified lines | |||
| 1097 | return NULL; | 1097 | return NULL; |
| 1098 | } | 1098 | } |
| 1099 | 1099 | ||
| 1100 | static inline void __cpu_map_flush(struct bpf_map *map) | 1100 | static inline void __cpu_map_flush(void) |
| 1101 | { | 1101 | { |
| 1102 | } | 1102 | } |
| 1103 | 1103 | ||