Commit 0fe875c5 authored by Wei Yongjun's avatar Wei Yongjun Committed by Daniel Borkmann

bpf: cpumap: make some functions static

Fixes the following sparse warnings:

kernel/bpf/cpumap.c:146:6: warning:
 symbol '__cpu_map_queue_destructor' was not declared. Should it be static?
kernel/bpf/cpumap.c:225:16: warning:
 symbol 'cpu_map_build_skb' was not declared. Should it be static?
kernel/bpf/cpumap.c:340:26: warning:
 symbol '__cpu_map_entry_alloc' was not declared. Should it be static?
kernel/bpf/cpumap.c:398:6: warning:
 symbol '__cpu_map_entry_free' was not declared. Should it be static?
kernel/bpf/cpumap.c:441:6: warning:
 symbol '__cpu_map_entry_replace' was not declared. Should it be static?
kernel/bpf/cpumap.c:454:5: warning:
 symbol 'cpu_map_delete_elem' was not declared. Should it be static?
kernel/bpf/cpumap.c:467:5: warning:
 symbol 'cpu_map_update_elem' was not declared. Should it be static?
kernel/bpf/cpumap.c:505:6: warning:
 symbol 'cpu_map_free' was not declared. Should it be static?
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 45e5e121
...@@ -137,7 +137,7 @@ static struct bpf_map *cpu_map_alloc(union bpf_attr *attr) ...@@ -137,7 +137,7 @@ static struct bpf_map *cpu_map_alloc(union bpf_attr *attr)
return ERR_PTR(err); return ERR_PTR(err);
} }
void __cpu_map_queue_destructor(void *ptr) static void __cpu_map_queue_destructor(void *ptr)
{ {
/* The tear-down procedure should have made sure that queue is /* The tear-down procedure should have made sure that queue is
* empty. See __cpu_map_entry_replace() and work-queue * empty. See __cpu_map_entry_replace() and work-queue
...@@ -216,7 +216,7 @@ static struct xdp_pkt *convert_to_xdp_pkt(struct xdp_buff *xdp) ...@@ -216,7 +216,7 @@ static struct xdp_pkt *convert_to_xdp_pkt(struct xdp_buff *xdp)
return xdp_pkt; return xdp_pkt;
} }
struct sk_buff *cpu_map_build_skb(struct bpf_cpu_map_entry *rcpu, static struct sk_buff *cpu_map_build_skb(struct bpf_cpu_map_entry *rcpu,
struct xdp_pkt *xdp_pkt) struct xdp_pkt *xdp_pkt)
{ {
unsigned int frame_size; unsigned int frame_size;
...@@ -331,7 +331,8 @@ static int cpu_map_kthread_run(void *data) ...@@ -331,7 +331,8 @@ static int cpu_map_kthread_run(void *data)
return 0; return 0;
} }
struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu, int map_id) static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu,
int map_id)
{ {
gfp_t gfp = GFP_ATOMIC|__GFP_NOWARN; gfp_t gfp = GFP_ATOMIC|__GFP_NOWARN;
struct bpf_cpu_map_entry *rcpu; struct bpf_cpu_map_entry *rcpu;
...@@ -389,7 +390,7 @@ struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu, int map_id) ...@@ -389,7 +390,7 @@ struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu, int map_id)
return NULL; return NULL;
} }
void __cpu_map_entry_free(struct rcu_head *rcu) static void __cpu_map_entry_free(struct rcu_head *rcu)
{ {
struct bpf_cpu_map_entry *rcpu; struct bpf_cpu_map_entry *rcpu;
int cpu; int cpu;
...@@ -432,7 +433,7 @@ void __cpu_map_entry_free(struct rcu_head *rcu) ...@@ -432,7 +433,7 @@ void __cpu_map_entry_free(struct rcu_head *rcu)
* cpu_map_kthread_stop, which waits for an RCU graze period before * cpu_map_kthread_stop, which waits for an RCU graze period before
* stopping kthread, emptying the queue. * stopping kthread, emptying the queue.
*/ */
void __cpu_map_entry_replace(struct bpf_cpu_map *cmap, static void __cpu_map_entry_replace(struct bpf_cpu_map *cmap,
u32 key_cpu, struct bpf_cpu_map_entry *rcpu) u32 key_cpu, struct bpf_cpu_map_entry *rcpu)
{ {
struct bpf_cpu_map_entry *old_rcpu; struct bpf_cpu_map_entry *old_rcpu;
...@@ -445,7 +446,7 @@ void __cpu_map_entry_replace(struct bpf_cpu_map *cmap, ...@@ -445,7 +446,7 @@ void __cpu_map_entry_replace(struct bpf_cpu_map *cmap,
} }
} }
int cpu_map_delete_elem(struct bpf_map *map, void *key) static int cpu_map_delete_elem(struct bpf_map *map, void *key)
{ {
struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map);
u32 key_cpu = *(u32 *)key; u32 key_cpu = *(u32 *)key;
...@@ -458,7 +459,7 @@ int cpu_map_delete_elem(struct bpf_map *map, void *key) ...@@ -458,7 +459,7 @@ int cpu_map_delete_elem(struct bpf_map *map, void *key)
return 0; return 0;
} }
int cpu_map_update_elem(struct bpf_map *map, void *key, void *value, static int cpu_map_update_elem(struct bpf_map *map, void *key, void *value,
u64 map_flags) u64 map_flags)
{ {
struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map);
...@@ -496,7 +497,7 @@ int cpu_map_update_elem(struct bpf_map *map, void *key, void *value, ...@@ -496,7 +497,7 @@ int cpu_map_update_elem(struct bpf_map *map, void *key, void *value,
return 0; return 0;
} }
void cpu_map_free(struct bpf_map *map) static void cpu_map_free(struct bpf_map *map)
{ {
struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map);
int cpu; int cpu;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment