* [net-next PATCH 1/2] bpf: sockmap remove unused function
@ 2018-01-04 1:57 John Fastabend
2018-01-04 1:57 ` [net-next PATCH 2/2] bpf: only build sockmap with CONFIG_INET John Fastabend
2018-01-04 22:27 ` [net-next PATCH 1/2] bpf: sockmap remove unused function Daniel Borkmann
0 siblings, 2 replies; 3+ messages in thread
From: John Fastabend @ 2018-01-04 1:57 UTC (permalink / raw)
To: borkmann, alexei.starovoitov; +Cc: netdev
This was added for some work that was eventually factored out but the
helper call was missed. Remove it now and add it back later if needed.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
kernel/bpf/sockmap.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 5ee2e41..3f662ee 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -96,14 +96,6 @@ static inline struct smap_psock *smap_psock_sk(const struct sock *sk)
return rcu_dereference_sk_user_data(sk);
}
-/* compute the linear packet data range [data, data_end) for skb when
- * sk_skb type programs are in use.
- */
-static inline void bpf_compute_data_end_sk_skb(struct sk_buff *skb)
-{
- TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb);
-}
-
enum __sk_action {
__SK_DROP = 0,
__SK_PASS,
^ permalink raw reply related [flat|nested] 3+ messages in thread* [net-next PATCH 2/2] bpf: only build sockmap with CONFIG_INET
2018-01-04 1:57 [net-next PATCH 1/2] bpf: sockmap remove unused function John Fastabend
@ 2018-01-04 1:57 ` John Fastabend
2018-01-04 22:27 ` [net-next PATCH 1/2] bpf: sockmap remove unused function Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2018-01-04 1:57 UTC (permalink / raw)
To: borkmann, alexei.starovoitov; +Cc: netdev
The sockmap infrastructure is only aware of TCP sockets at the
moment. In the future we plan to add UDP. In both cases CONFIG_NET
should be built-in.
So lets only build sockmap if CONFIG_INET is enabled.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
include/linux/bpf.h | 2 +-
include/linux/bpf_types.h | 2 +-
kernel/bpf/Makefile | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 7810ae5..9e03046 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -554,7 +554,7 @@ static inline bool bpf_prog_is_dev_bound(struct bpf_prog_aux *aux)
}
#endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */
-#if defined(CONFIG_STREAM_PARSER) && defined(CONFIG_BPF_SYSCALL)
+#if defined(CONFIG_STREAM_PARSER) && defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_INET)
struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key);
int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type);
#else
diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h
index 978c1d9..19b8349 100644
--- a/include/linux/bpf_types.h
+++ b/include/linux/bpf_types.h
@@ -42,7 +42,7 @@
BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
#ifdef CONFIG_NET
BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
-#ifdef CONFIG_STREAM_PARSER
+#if defined(CONFIG_STREAM_PARSER) && defined(CONFIG_INET)
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
#endif
BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile
index e691da0..a713fd2 100644
--- a/kernel/bpf/Makefile
+++ b/kernel/bpf/Makefile
@@ -9,9 +9,11 @@ obj-$(CONFIG_BPF_SYSCALL) += devmap.o
obj-$(CONFIG_BPF_SYSCALL) += cpumap.o
obj-$(CONFIG_BPF_SYSCALL) += offload.o
ifeq ($(CONFIG_STREAM_PARSER),y)
+ifeq ($(CONFIG_INET),y)
obj-$(CONFIG_BPF_SYSCALL) += sockmap.o
endif
endif
+endif
ifeq ($(CONFIG_PERF_EVENTS),y)
obj-$(CONFIG_BPF_SYSCALL) += stackmap.o
endif
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net-next PATCH 1/2] bpf: sockmap remove unused function
2018-01-04 1:57 [net-next PATCH 1/2] bpf: sockmap remove unused function John Fastabend
2018-01-04 1:57 ` [net-next PATCH 2/2] bpf: only build sockmap with CONFIG_INET John Fastabend
@ 2018-01-04 22:27 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-01-04 22:27 UTC (permalink / raw)
To: John Fastabend, borkmann, alexei.starovoitov; +Cc: netdev
On 01/04/2018 02:57 AM, John Fastabend wrote:
> This was added for some work that was eventually factored out but the
> helper call was missed. Remove it now and add it back later if needed.
>
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Both applied to bpf-next, thanks John!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-04 22:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04 1:57 [net-next PATCH 1/2] bpf: sockmap remove unused function John Fastabend
2018-01-04 1:57 ` [net-next PATCH 2/2] bpf: only build sockmap with CONFIG_INET John Fastabend
2018-01-04 22:27 ` [net-next PATCH 1/2] bpf: sockmap remove unused function Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox