On Tue, Jun 23, 2020 at 10:59:37PM +0200, Jakub Sitnicki wrote:
> On Tue, Jun 23, 2020 at 09:33 PM CEST, Martin KaFai Lau wrote:
> > On Tue, Jun 23, 2020 at 12:34:58PM +0200, Jakub Sitnicki wrote:
> >
> > [ ... ]
> >
> >> @@ -93,8 +108,16 @@ static int bpf_ne
On Tue, Jun 23, 2020 at 12:34:58PM +0200, Jakub Sitnicki wrote:
[ ... ]
> @@ -93,8 +108,16 @@ static int bpf_netns_link_update_prog(struct bpf_link
> *link,
> goto out_unlock;
> }
>
> + run_array = rcu_dereference_protected(net->bpf.run_array[type],
> +
count for each cache_idx. There is
16 of them now (defined in BPF_SK_STORAGE_CACHE_SIZE).
It will try to pick the free cache_idx. If none was found,
it would pick one with the minimal usage count.
Signed-off-by: Martin KaFai Lau
---
net/core/bpf_sk_storage.c | 41
On Tue, May 26, 2020 at 10:54:26AM -0700, Andrii Nakryiko wrote:
> On Fri, May 22, 2020 at 6:01 PM Martin KaFai Lau wrote:
> >
> > On Sat, May 23, 2020 at 12:22:48AM +0200, Daniel Borkmann wrote:
> > > On 5/22/20 4:23 AM, Martin KaFai Lau wrote:
> > > [...]
> &
ger value and do not need ns_capable()),
do_tcp_setsockopt() and sock_setsockopt() can be directly called with
some refactoring.
The change looks good. For this patch,
Acked-by: Martin KaFai Lau
On Sat, May 23, 2020 at 12:22:48AM +0200, Daniel Borkmann wrote:
> On 5/22/20 4:23 AM, Martin KaFai Lau wrote:
> [...]
> > };
> > +/* Cannot be used as an inner map */
> > +#define BPF_MAP_NO_INNER_MAP (1 << 0)
> > +
> > struct bpf_map {
> >
one when a map's properties is decided at the same
place as the new map type is added in bpf_types.h. That will help to
avoid mistake like missing modification in other source files like
the map_in_map.c here or other source files in the future.
Cc: Andrey Ignatov
Signed-off-by: Martin KaFai Lau
with a smaller inner map first and then replaces
it with a larger inner map later when it is needed.
The max_entries of arraymap and xskmap are used statically
in verification time to generate the inline code, so they
are excluded in this patch.
Cc: Andrey Ignatov
Signed-off-by: Martin KaFai Lau
time during prog load).
Please see individual patch for details.
v2:
- New BPF_MAP_TYPE_FL to minimize code churns (Alexei)
- s/capabilities/properties/ (Andrii)
- Describe WHY in commit log (Andrii)
Martin KaFai Lau (3):
bpf: Consolidate inner-map-compatible properties into bpf_types.h
bpf
This patch tests the inner map size can be different
for reuseport_sockarray but has to be the same for
arraymap.
Cc: Andrey Ignatov
Signed-off-by: Martin KaFai Lau
---
.../selftests/bpf/prog_tests/btf_map_in_map.c | 12 +++
.../selftests/bpf/progs/test_btf_map_in_map.c | 31
On Thu, May 21, 2020 at 04:16:18PM -0700, Alexei Starovoitov wrote:
> On Thu, May 21, 2020 at 04:10:36PM -0700, Andrii Nakryiko wrote:
> > > > 4. Then for size check change, again, it's really much simpler and
> > > > cleaner just to have a special case in check in bpf_map_meta_equal for
> > > > ca
On Thu, May 21, 2020 at 03:39:10PM -0700, Andrii Nakryiko wrote:
> On Thu, May 21, 2020 at 12:18 PM Martin KaFai Lau wrote:
> >
> > This series allows the outer map to be updated with inner map in different
> > size as long as it is safe (meaning the max_entri
This patch tests the inner map size can be different
for reuseport_sockarray but has to be the same for
arraymap.
Cc: Andrey Ignatov
Signed-off-by: Martin KaFai Lau
---
.../selftests/bpf/prog_tests/btf_map_in_map.c | 12 +++
.../selftests/bpf/progs/test_btf_map_in_map.c | 31
xskmap are used statically
in verification time to generate the inline code, so they
are excluded in this patch.
Cc: Andrey Ignatov
Signed-off-by: Martin KaFai Lau
---
include/linux/bpf.h | 12
include/linux/bpf_types.h | 6 --
kernel/bpf/map_in_map.c | 3 ++-
3 files
This series allows the outer map to be updated with inner map in different
size as long as it is safe (meaning the max_entries is not used in the
verification time during prog load).
Please see individual patch for details.
Martin KaFai Lau (3):
bpf: Clean up inner map type check
bpf: Relax
l be less error prone to decide its capability at the same place
as the new map type is added in bpf_types.h. That will help to avoid
mistake like missing modification in other source files like
the map_in_map.c here.
Cc: Andrey Ignatov
Signed-off-by: Martin KaFai Lau
---
include/linux/b
match_sk1_wildcard" and "bool match_sk2_wildcard".
This change only affects the sk_reuseport_match() which is only
used by inet_csk (e.g. TCP).
The other use cases are calling inet_rcv_saddr_equal() and
this patch makes it pass the same "match_wildcard" arg twice to
the "ip
On Wed, May 13, 2020 at 04:34:13PM +0200, Jakub Sitnicki wrote:
> On Wed, May 13, 2020 at 07:41 AM CEST, Martin KaFai Lau wrote:
> > On Mon, May 11, 2020 at 08:52:03PM +0200, Jakub Sitnicki wrote:
> >
> > [ ... ]
> >
> >> +BPF_CALL_3(bpf_sk_lookup_assi
On Mon, May 11, 2020 at 08:52:03PM +0200, Jakub Sitnicki wrote:
[ ... ]
> +BPF_CALL_3(bpf_sk_lookup_assign, struct bpf_sk_lookup_kern *, ctx,
> +struct sock *, sk, u64, flags)
The SK_LOOKUP bpf_prog may have already selected the proper reuseport sk.
It is possible by looking up sk from so
On Tue, May 12, 2020 at 01:57:45PM +0200, Jakub Sitnicki wrote:
> On Mon, May 11, 2020 at 09:45 PM CEST, Martin KaFai Lau wrote:
> > On Mon, May 11, 2020 at 08:52:01PM +0200, Jakub Sitnicki wrote:
> >
> > [ ... ]
> >
> >> Performance considerations
> >&g
On Mon, May 11, 2020 at 09:26:02PM +0200, Jakub Sitnicki wrote:
> On Mon, May 11, 2020 at 08:59 PM CEST, Martin KaFai Lau wrote:
> > On Mon, May 11, 2020 at 11:08:15AM +0200, Jakub Sitnicki wrote:
> >> On Fri, May 08, 2020 at 08:39 PM CEST, Martin KaFai Lau wrote:
> >> &
On Mon, May 11, 2020 at 08:52:01PM +0200, Jakub Sitnicki wrote:
[ ... ]
> Performance considerations
> ==
>
> Patch set adds new code on receive hot path. This comes with a cost,
> especially in a scenario of a SYN flood or small UDP packet flood.
>
> Measuring the perfo
On Mon, May 11, 2020 at 11:08:15AM +0200, Jakub Sitnicki wrote:
> On Fri, May 08, 2020 at 08:39 PM CEST, Martin KaFai Lau wrote:
> > On Fri, May 08, 2020 at 12:45:14PM +0200, Jakub Sitnicki wrote:
> >> On Fri, May 08, 2020 at 09:06 AM CEST, Martin KaFai Lau wrote:
> >> &
On Fri, May 08, 2020 at 12:45:14PM +0200, Jakub Sitnicki wrote:
> On Fri, May 08, 2020 at 09:06 AM CEST, Martin KaFai Lau wrote:
> > On Wed, May 06, 2020 at 02:54:58PM +0200, Jakub Sitnicki wrote:
> >> Add a new program type BPF_PROG_TYPE_SK_LOOKUP and a dedicated attac
tified by fd
>
> These will be used in the next commit.
>
> Also, extend these helpers to support AF_INET6 and accept the family
> as an argument.
>
> v4:
> * export extra helper to start server without a thread (Martin KaFai Lau)
> * tcp_rtt is no longer starting backg
On Thu, May 07, 2020 at 12:12:13PM -0700, Stanislav Fomichev wrote:
> 1. Move pkt_v4 and pkt_v6 into network_helpers and adjust the users.
> 2. Copy-paste spin_lock_thread into two tests that use it.
>
> Cc: Martin KaFai Lau
> Signed-off-by: Stanislav Fomichev
Acked-by: Martin KaFai Lau
On Wed, May 06, 2020 at 02:54:58PM +0200, Jakub Sitnicki wrote:
> Add a new program type BPF_PROG_TYPE_SK_LOOKUP and a dedicated attach type
> called BPF_SK_LOOKUP. The new program kind is to be invoked by the
> transport layer when looking up a socket for a received packet.
>
> When called, SK_LO
On Wed, May 06, 2020 at 03:53:35PM +0200, Jakub Sitnicki wrote:
> On Wed, May 06, 2020 at 03:16 PM CEST, Lorenz Bauer wrote:
> > On Wed, 6 May 2020 at 13:55, Jakub Sitnicki wrote:
>
> [...]
>
> >> @@ -4012,4 +4051,18 @@ struct bpf_pidns_info {
> >> __u32 pid;
> >> __u32 tgid;
> >
nd flag
> to indicate that the call site is BPF program.
>
> v3:
> * More bpf_bind documentation refinements (Martin KaFai Lau)
> * Add UDP tests as well (Martin KaFai Lau)
> * Don't start the thread, just do socket+bind+listen (Martin KaFai Lau)
>
> v2:
> * Update d
ges.
>
> Cc: Andrey Ignatov
> Cc: Martin KaFai Lau
> Signed-off-by: Stanislav Fomichev
Acked-by: Martin KaFai Lau
On Wed, May 06, 2020 at 03:32:08PM -0700, Stanislav Fomichev wrote:
> 1. Move pkt_v4 and pkt_v6 into network_helpers and adjust the users.
> 2. Copy-paste spin_lock_thread into two tests that use it.
Instead of copying it into two tests,
can spin_lock_thread be moved to network-helpers.c?
p the thread
> * connect_to_fd - connect to the server identified by fd
>
> These will be used in the next commit.
>
> Also, extend these helpers to support AF_INET6 and accept the family
> as an argument.
>
> v3:
> * export extra helper to start server without a thr
On Wed, May 06, 2020 at 10:03:52PM +0800, Jason Yan wrote:
> The '==' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
Make sense.
It may belong to bpf-next instead.
Acked-by: Martin KaFai Lau
On Wed, May 06, 2020 at 09:22:45AM -0700, s...@google.com wrote:
> On 05/05, Martin KaFai Lau wrote:
> > On Tue, May 05, 2020 at 01:27:29PM -0700, Stanislav Fomichev wrote:
> > > We want to have a tighter control on what ports we bind to in
> > > the BPF_CGROUP_INET{4,
On Wed, May 06, 2020 at 09:28:02AM -0700, s...@google.com wrote:
> On 05/06, Martin KaFai Lau wrote:
> > On Tue, May 05, 2020 at 01:27:26PM -0700, Stanislav Fomichev wrote:
> > > Move the following routines that let us start a background listener
> > > thread and conne
On Tue, May 05, 2020 at 01:27:26PM -0700, Stanislav Fomichev wrote:
> Move the following routines that let us start a background listener
> thread and connect to a server by fd to the test_prog:
> * start_server_thread - start background INADDR_ANY thread
> * stop_server_thread - stop the thread
>
On Tue, May 05, 2020 at 01:27:29PM -0700, Stanislav Fomichev wrote:
> We want to have a tighter control on what ports we bind to in
> the BPF_CGROUP_INET{4,6}_CONNECT hooks even if it means
> connect() becomes slightly more expensive. The expensive part
> comes from the fact that we now need to cal
_elem+0xdd/0x120
> [ 173.700060] kasan_report+0x32/0x50
> [ 173.700070] sk_msg_free_elem+0xdd/0x120
> [ 173.700080] __sk_msg_free+0x87/0x150
> [ 173.700094] tcp_bpf_send_verdict+0x179/0x4f0
> [ 173.700109] tcp_bpf_sendpage+0x3ce/0x5d0
>
> Fixes: 604326b41a6fb ("bpf, sockmap: convert to generic sk_msg interface")
> Signed-off-by: John Fastabend
Acked-by: Martin KaFai Lau
this.
>
> Fixes: 7246d8ed4dcce ("bpf: helper to pop data from messages")
> Signed-off-by: John Fastabend
Acked-by: Martin KaFai Lau
On Mon, May 04, 2020 at 10:34:29AM -0700, Stanislav Fomichev wrote:
> The intent is to add an additional bind parameter in the next commit.
> Instead of adding another argument, let's convert all existing
> flag arguments into an extendable bit field.
>
> No functional changes.
>
> Cc: Andrey Ign
27;bpf_stats_handler'
> [-Werror,-Wunused-function]
> static int bpf_stats_handler(struct ctl_table *table, int write,
>
> Fix the check to match the reference.
>
> Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")
> Signed-off-by: Arnd Bergmann
Acked-by: Martin KaFai Lau
On Fri, May 01, 2020 at 03:43:20PM -0700, Stanislav Fomichev wrote:
> Andrey pointed out that we can use reno instead of dctcp for CC
> tests and drop CONFIG_TCP_CONG_DCTCP=y requirement.
Acked-by: Martin KaFai Lau
file. Adding ID to
> link_idr is ok, because link at that point still doesn't have its ID set, so
> no user-space process can create a new FD for it.
Acked-by: Martin KaFai Lau
On Thu, Apr 30, 2020 at 11:32:59PM -0700, Andrii Nakryiko wrote:
> On Thu, Apr 30, 2020 at 11:25 PM Martin KaFai Lau wrote:
> >
> > On Thu, Apr 30, 2020 at 12:46:08PM -0700, Andrii Nakryiko wrote:
> > > If bpf_link_prime() succeeds to allocate new anon file, but then fa
On Thu, Apr 30, 2020 at 12:46:08PM -0700, Andrii Nakryiko wrote:
> If bpf_link_prime() succeeds to allocate new anon file, but then fails to
> allocate ID for it, link priming is considered to be failed and user is
> supposed ot be able to directly kfree() bpf_link, because it was never exposed
> t
> v3:
> * Expose custom helpers for bpf_sock_addr context instead of doing
> generic bpf_sock argument (as suggested by Daniel). Even with
> try_socket_lock that doesn't sleep we have a problem where context sk
> is already locked and socket lock is non-nestable.
Acked-by: Martin KaFai Lau
On Wed, Apr 29, 2020 at 12:20:05PM -0700, Yonghong Song wrote:
>
>
> On 4/29/20 11:46 AM, Martin KaFai Lau wrote:
> > On Wed, Apr 29, 2020 at 11:16:35AM -0700, Andrii Nakryiko wrote:
> > > On Wed, Apr 29, 2020 at 12:07 AM Yonghong Song wrote:
> > > >
> &
On Wed, Apr 29, 2020 at 11:16:35AM -0700, Andrii Nakryiko wrote:
> On Wed, Apr 29, 2020 at 12:07 AM Yonghong Song wrote:
> >
> >
> >
> > On 4/28/20 11:56 PM, Andrii Nakryiko wrote:
> > > On Mon, Apr 27, 2020 at 1:19 PM Yonghong Song wrote:
> > >>
> > >> A new bpf command BPF_ITER_CREATE is added.
On Tue, Apr 28, 2020 at 11:57:19AM -0700, Stanislav Fomichev wrote:
> Currently, bpf_getsocktop and bpf_setsockopt helpers operate on the
> 'struct bpf_sock_ops' context in BPF_PROG_TYPE_CGROUP_SOCKOPT program.
> Let's generalize them and make the first argument be 'struct bpf_sock'.
> That way, in
On Tue, Apr 28, 2020 at 11:32:15PM -0700, Andrii Nakryiko wrote:
> On Tue, Apr 28, 2020 at 10:59 PM Martin KaFai Lau wrote:
> >
> > On Tue, Apr 28, 2020 at 10:04:54PM -0700, Yonghong Song wrote:
> > >
> > >
> > > On 4/28/20 6:32 PM, Martin KaFai Lau wr
te:
> > > > On 4/28/20 6:15 PM, Yonghong Song wrote:
> > > > >
> > > > >
> > > > > On 4/28/20 5:48 PM, Alexei Starovoitov wrote:
> > > > > > On 4/28/20 5:37 PM, Martin KaFai Lau wrote:
> > > > > >
On Tue, Apr 28, 2020 at 10:04:54PM -0700, Yonghong Song wrote:
>
>
> On 4/28/20 6:32 PM, Martin KaFai Lau wrote:
> > On Mon, Apr 27, 2020 at 01:12:41PM -0700, Yonghong Song wrote:
> > > Added BPF_LINK_UPDATE support for tracing/iter programs.
> > > This way,
On Mon, Apr 27, 2020 at 01:12:42PM -0700, Yonghong Song wrote:
> A new bpf command BPF_ITER_CREATE is added.
>
> The anonymous bpf iterator is seq_file based.
> The seq_file private data are referenced by targets.
> The bpf_iter infrastructure allocated additional space
> at seq_file->private afte
On Mon, Apr 27, 2020 at 01:12:41PM -0700, Yonghong Song wrote:
> Added BPF_LINK_UPDATE support for tracing/iter programs.
> This way, a file based bpf iterator, which holds a reference
> to the link, can have its bpf program updated without
> creating new files.
>
> Signed-off-by: Yonghong Song
>
On Mon, Apr 27, 2020 at 01:12:40PM -0700, Yonghong Song wrote:
> Given a bpf program, the step to create an anonymous bpf iterator is:
> - create a bpf_iter_link, which combines bpf program and the target.
> In the future, there could be more information recorded in the link.
> A link_fd
On Mon, Apr 27, 2020 at 01:12:39PM -0700, Yonghong Song wrote:
> A bpf_iter program is a tracing program with attach type
> BPF_TRACE_ITER. The load attribute
> attach_btf_id
> is used by the verifier against a particular kernel function,
> e.g., __bpf_iter__bpf_map in our previous bpf_map iterat
On Mon, Apr 27, 2020 at 01:12:37PM -0700, Yonghong Song wrote:
> The bpf_map iterator is implemented.
> The bpf program is called at seq_ops show() and stop() functions.
> bpf_iter_get_prog() will retrieve bpf program and other
> parameters during seq_file object traversal. In show() function,
> bp
On Mon, Apr 27, 2020 at 01:12:36PM -0700, Yonghong Song wrote:
> The target can call bpf_iter_reg_target() to register itself.
> The needed information:
> target: target name, reprsented as a directory hierarchy
> target_func_name: the kernel func name used by verifier to
>
and this fix is depending on it.
Fixes: a4298e4522d6 ("net: add SOCK_RCU_FREE socket flag")
Cc: Eric Dumazet
Suggested-by: Eric Dumazet
Signed-off-by: Martin KaFai Lau
---
net/core/sock.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/net/core/sock.c
path. The lock is taken inside the loop in case
that the bpf map is big.
Signed-off-by: Martin KaFai Lau
---
kernel/bpf/reuseport_array.c | 27 +--
1 file changed, 5 insertions(+), 22 deletions(-)
diff --git a/kernel/bpf/reuseport_array.c b/kernel/bpf/reuseport_array.c
This patch adds a test for the new sockopt SO_REUSEPORT_DETACH_BPF.
Signed-off-by: Martin KaFai Lau
---
.../selftests/bpf/test_select_reuseport.c | 54 +++
1 file changed, 54 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_select_reuseport.c
b/tools/testing
are,
it does not call reuseport_alloc() and returns -ENOENT when
there is no old prog.
Cc: Craig Gallek
Signed-off-by: Martin KaFai Lau
---
arch/alpha/include/uapi/asm/socket.h | 2 ++
arch/mips/include/uapi/asm/socket.h | 2 ++
arch/parisc/include/uapi/asm/socket.h | 2 ++
arch/sparc
v3:
- Use rcu_swap_protected (Stanislav Fomichev)
- Use 0x0047 for SO_DETACH_REUSEPORT_BPF for sparc (kbuild test robot
)
v2:
- Copy asm-generic/socket.h to tools/ in the new patch 2 (Stanislav Fomichev)
This patch adds SO_DETACH_REUSEPORT_BPF to detach BPF prog from
reuseport sk.
Martin KaFai
SO_DETACH_REUSEPORT_BPF is needed for the test in the next patch.
It is defined in the socket.h.
Signed-off-by: Martin KaFai Lau
---
tools/include/uapi/asm-generic/socket.h | 147
1 file changed, 147 insertions(+)
create mode 100644 tools/include/uapi/asm-generic
are,
it does not call reuseport_alloc() and returns -ENOENT when
there is no old prog.
Cc: Craig Gallek
Signed-off-by: Martin KaFai Lau
---
arch/alpha/include/uapi/asm/socket.h | 2 ++
arch/mips/include/uapi/asm/socket.h | 2 ++
arch/parisc/include/uapi/asm/socket.h | 2 ++
arch/sparc
This patch adds a test for the new sockopt SO_REUSEPORT_DETACH_BPF.
Signed-off-by: Martin KaFai Lau
---
.../selftests/bpf/test_select_reuseport.c | 54 +++
1 file changed, 54 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_select_reuseport.c
b/tools/testing
v2:
Copy asm-generic/socket.h to tools/ in the new patch 2 (Stanislav Fomichev)
This patch adds SO_DETACH_REUSEPORT_BPF to detach BPF prog from
reuseport sk.
Martin KaFai Lau (3):
bpf: net: Add SO_DETACH_REUSEPORT_BPF
bpf: Sync asm-generic/socket.h to tools/
bpf: Add test for
SO_DETACH_REUSEPORT_BPF is needed for the test in the next patch.
It is defined in the socket.h.
Signed-off-by: Martin KaFai Lau
---
tools/include/uapi/asm-generic/socket.h | 147
1 file changed, 147 insertions(+)
create mode 100644 tools/include/uapi/asm-generic
are,
it does not call reuseport_alloc() and returns -ENOENT when
there is no old prog.
Cc: Craig Gallek
Signed-off-by: Martin KaFai Lau
---
arch/alpha/include/uapi/asm/socket.h | 2 ++
arch/mips/include/uapi/asm/socket.h | 2 ++
arch/parisc/include/uapi/asm/socket.h | 2 ++
arch/sparc
This patch adds a test for the new sockopt SO_REUSEPORT_DETACH_BPF.
'-I../../../../usr/include/' is added to the Makefile to get
the newly added SO_REUSEPORT_DETACH_BPF.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf/Makefile | 1 +
.../sel
This patch adds SO_DETACH_REUSEPORT_BPF to detach BPF prog from
reuseport sk.
Martin KaFai Lau (2):
bpf: net: Add SO_DETACH_REUSEPORT_BPF
bpf: Add test for SO_REUSEPORT_DETACH_BPF
arch/alpha/include/uapi/asm/socket.h | 2 +
arch/mips/include/uapi/asm/socket.h | 2
The cloned sk should not carry its parent-listener's sk_bpf_storage.
This patch fixes it by setting it back to NULL.
Fixes: 6ac99e8f23d4 ("bpf: Introduce bpf sk local storage")
Signed-off-by: Martin KaFai Lau
---
net/core/sock.c | 3 +++
1 file changed, 3 insertions(+)
diff -
ic
to running bpf_prog, so bpf tag is used for this series.
Please refer to the individual commit message for details.
Martin KaFai Lau (2):
bpf: udp: ipv6: Avoid running reuseport's bpf_prog from __udp6_lib_err
bpf: udp: Avoid calling reuseport's bpf_prog from udp_gro
net/ipv4/udp
PF")
Cc: Craig Gallek
Signed-off-by: Martin KaFai Lau
---
net/ipv6/udp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 07fa579dfb96..133e6370f89c 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -515,7 +515,7 @@ int __udp6_l
ng a NULL skb to avoid calling the reuseport's bpf_prog.
Fixes: a6024562ffd7 ("udp: Add GRO functions to UDP socket")
Cc: Tom Herbert
Signed-off-by: Martin KaFai Lau
---
net/ipv4/udp.c | 6 +-
net/ipv6/udp.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git
alled if needed and then returns NULL.
Fixes: 6acc9b432e67 ("bpf: Add helper to retrieve socket in BPF")
Cc: Joe Stringer
Signed-off-by: Martin KaFai Lau
---
net/core/filter.c | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/core/filter.c b/ne
uot;net/ipv6: Make from in rt6_info rcu protected")
Signed-off-by: Martin KaFai Lau
---
net/ipv6/route.c | 38 ++
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b4899f0de0d0..73ef72c208af 100644
---
This patch rides on an existing BPF_PROG_TYPE_CGROUP_SKB test
(test_sock_fields.c) to do a TCP end-to-end test on the new
bpf_sk_storage_* helpers.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf/bpf_helpers.h | 5 +
.../bpf/progs/test_sock_fields_kern.c | 53
: Yonghong Song
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf/test_verifier.c | 55 ++
tools/testing/selftests/bpf/verifier/sock.c | 116
2 files changed, 152 insertions(+), 19 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_verifier.
Refactor common BTF encoding macros for other tests to use.
The libbpf may reuse some of them in the future which requires
some more thoughts before publishing as a libbpf API.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf/test_btf.c | 63 +--
tools
in patch 1
(kbuild test robot )
v2:
- Add the "test_maps.h" file in patch 5
This series introduces the BPF sk local storage. The
details is in the patch 1 commit message.
Martin KaFai Lau (7):
bpf: Introduce bpf sk local storage
bpf: Sync bpf.h to tools
bp
This patch adds BPF_MAP_TYPE_SK_STORAGE test to test_maps.
The src file is rather long, so it is put into another dir map_tests/
and compile like the current prog_tests/ does. Other existing
tests in test_maps can also be re-factored into map_tests/ in the
future.
Signed-off-by: Martin KaFai Lau
│ list ├───▶│map_node│ │
│ │└┘ │
│ ││
│ │ elem │
└─┘┌┐ │
┌─▶│ snode │ │
│ ├┤ │
│ │ data │ │
│ ├┤ │
│ │map_node│◀─┘
│ └────┘
This patch supports probing for the new BPF_MAP_TYPE_SK_STORAGE.
BPF_MAP_TYPE_SK_STORAGE enforces BTF usage, so the new probe
requires to create and load a BTF also.
Signed-off-by: Martin KaFai Lau
---
tools/bpf/bpftool/map.c | 1 +
tools/lib/bpf/libbpf_probes.c | 74
This patch sync the bpf.h to tools/.
Signed-off-by: Martin KaFai Lau
---
tools/include/uapi/linux/bpf.h | 44 +-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 704bb69514a2
This patch supports probing for the new BPF_MAP_TYPE_SK_STORAGE.
BPF_MAP_TYPE_SK_STORAGE enforces BTF usage, so the new probe
requires to create and load a BTF also.
Signed-off-by: Martin KaFai Lau
---
tools/bpf/bpftool/map.c | 1 +
tools/lib/bpf/libbpf_probes.c | 74
lem │
└─┘┌┐ │
┌─▶│ snode │ │
│ ├┤ │
│ │ data │ │
│ ├┤ │
│ │map_node│◀─┘
│ └┘
│
│
│ ┌───
This patch adds BPF_MAP_TYPE_SK_STORAGE test to test_maps.
The src file is rather long, so it is put into another dir map_tests/
and compile like the current prog_tests/ does. Other existing
tests in test_maps can also be re-factored into map_tests/ in the
future.
Signed-off-by: Martin KaFai Lau
v3:
- Replace spinlock_types.h with spinlock.h in patch 1
(kbuild test robot )
v2:
- Add the "test_maps.h" file in patch 5
This series introduces the BPF sk local storage. The
details is in the patch 1 commit message.
Martin KaFai Lau (6):
bpf: Introduce bpf sk local storage
This patch sync the bpf.h to tools/.
Signed-off-by: Martin KaFai Lau
---
tools/include/uapi/linux/bpf.h | 44 +-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 704bb69514a2
This patch adds verifier tests for the bpf_sk_storage:
1. ARG_PTR_TO_MAP_VALUE_OR_NULL
2. Map and helper compatibility (e.g. disallow bpf_map_loookup_elem)
It also takes this chance to remove the unused struct btf_raw_data.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf
This patch rides on an existing BPF_PROG_TYPE_CGROUP_SKB test
(test_sock_fields.c) to do a TCP end-to-end test on the new
bpf_sk_storage_* helpers.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf/bpf_helpers.h | 5 +
.../bpf/progs/test_sock_fields_kern.c | 49
This patch supports probing for the new BPF_MAP_TYPE_SK_STORAGE.
BPF_MAP_TYPE_SK_STORAGE enforces BTF usage, so the new probe
requires to create and load a BTF also.
Signed-off-by: Martin KaFai Lau
---
tools/bpf/bpftool/map.c | 1 +
tools/lib/bpf/libbpf_probes.c | 74
This patch sync the bpf.h to tools/.
Signed-off-by: Martin KaFai Lau
---
tools/include/uapi/linux/bpf.h | 44 +-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 704bb69514a2
| elem |
+-+++ |
+->| snode | |
| ++ |
| | data | |
| ++ |
| |map_node|<-+
| +----+
|
|
This patch adds verifier tests for the bpf_sk_storage:
1. ARG_PTR_TO_MAP_VALUE_OR_NULL
2. Map and helper compatibility (e.g. disallow bpf_map_loookup_elem)
It also takes this chance to remove the unused struct btf_raw_data.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf
This patch rides on an existing BPF_PROG_TYPE_CGROUP_SKB test
(test_sock_fields.c) to do a TCP end-to-end test on the new
bpf_sk_storage_* helpers.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf/bpf_helpers.h | 5 +
.../bpf/progs/test_sock_fields_kern.c | 49
This patch adds BPF_MAP_TYPE_SK_STORAGE test to test_maps.
The src file is rather long, so it is put into another dir map_tests/
and compile like the current prog_tests/ does. Other existing
tests in test_maps can also be re-factored into map_tests/ in the
future.
Signed-off-by: Martin KaFai Lau
v2:
- Add the "test_maps.h" file in patch 5
This series introduces the BPF sk local storage. The
details is in the patch 1 commit message.
Martin KaFai Lau (6):
bpf: Introduce bpf sk local storage
bpf: Sync bpf.h to tools
bpf: Support BPF_MAP_TYPE_SK_STORAGE in bpf map probing
This patch rides on an existing BPF_PROG_TYPE_CGROUP_SKB test
(test_sock_fields.c) to do a TCP end-to-end test on the new
bpf_sk_storage_* helpers.
Signed-off-by: Martin KaFai Lau
---
tools/testing/selftests/bpf/bpf_helpers.h | 5 +
.../bpf/progs/test_sock_fields_kern.c | 49
401 - 500 of 1277 matches
Mail list logo