* [net-next PATCH] net: fix build error in devmap helper calls
@ 2017-07-18 4:56 John Fastabend
2017-07-18 5:48 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: John Fastabend @ 2017-07-18 4:56 UTC (permalink / raw)
To: davem; +Cc: netdev, john.fastabend
Initial patches missed case with CONFIG_BPF_SYSCALL not set.
Fixes: 11393cc9b9be ("xdp: Add batching support to redirect map")
Fixes: 97f91a7cf04f ("bpf: add bpf_redirect_map helper routine")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
include/linux/bpf.h | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 6850a76..6353c74 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -318,6 +318,12 @@ static inline void bpf_long_memcpy(void *dst, const void *src, u32 size)
/* verify correctness of eBPF program */
int bpf_check(struct bpf_prog **fp, union bpf_attr *attr);
+
+/* Map specifics */
+struct net_device *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
+void __dev_map_insert_ctx(struct bpf_map *map, u32 index);
+void __dev_map_flush(struct bpf_map *map);
+
#else
static inline struct bpf_prog *bpf_prog_get(u32 ufd)
{
@@ -356,6 +362,20 @@ static inline int __bpf_prog_charge(struct user_struct *user, u32 pages)
static inline void __bpf_prog_uncharge(struct user_struct *user, u32 pages)
{
}
+
+static inline struct net_device *__dev_map_lookup_elem(struct bpf_map *map,
+ u32 key)
+{
+ return NULL;
+}
+
+static inline void __dev_map_insert_ctx(struct bpf_map *map, u32 index)
+{
+}
+
+static inline void __dev_map_flush(struct bpf_map *map)
+{
+}
#endif /* CONFIG_BPF_SYSCALL */
/* verifier prototypes for helper functions called from eBPF programs */
@@ -379,9 +399,4 @@ static inline void __bpf_prog_uncharge(struct user_struct *user, u32 pages)
void bpf_user_rnd_init_once(void);
u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
-/* Map specifics */
-struct net_device *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
-void __dev_map_insert_ctx(struct bpf_map *map, u32 index);
-void __dev_map_flush(struct bpf_map *map);
-
#endif /* _LINUX_BPF_H */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net-next PATCH] net: fix build error in devmap helper calls
2017-07-18 4:56 [net-next PATCH] net: fix build error in devmap helper calls John Fastabend
@ 2017-07-18 5:48 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-07-18 5:48 UTC (permalink / raw)
To: john.fastabend; +Cc: netdev
From: John Fastabend <john.fastabend@gmail.com>
Date: Mon, 17 Jul 2017 21:56:48 -0700
> Initial patches missed case with CONFIG_BPF_SYSCALL not set.
>
> Fixes: 11393cc9b9be ("xdp: Add batching support to redirect map")
> Fixes: 97f91a7cf04f ("bpf: add bpf_redirect_map helper routine")
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-18 5:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 4:56 [net-next PATCH] net: fix build error in devmap helper calls John Fastabend
2017-07-18 5:48 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).